From: Adnan DURSUN <a_dursun@hotmail.com>
To: pgsql-performance@postgresql.org
Subject: Re: SQL Function Performance
Date: Wed, 15 Feb 2006 00:35:59 +0200
Message-ID: <BAY106-DAV244F7CACF7398D74C15861FA060@phx.gbl> (raw)
-------Original Message-------
From: Michael Fuhr
Date: 02/14/06 23:05:55
To: Adnan DURSUN
Cc: pgsql-performance@postgresql.org
Subject: Re: [PERFORM] SQL Function Performance
>On Tue, Feb 14, 2006 at 11:33:57AM +0200, Adnan DURSUN wrote:
>> -> Nested Loop (cost=5.90..267.19 rows=3 width=101) (actual time=76.240..30974.777 rows=63193 loops=1)
>> -> Nested Loop (cost=5.90..123.48 rows=26 width=73) (actual time=32.082..4357.786 rows=14296 loops=1)
>Absent a better solution, you could write a PL/pgSQL function and
>build the query as a text string, then EXECUTE it. That would give
>you a new plan each time, one that can take better advantage of
>statistics, at the cost of having to plan the query each time you
>call the function (but you probably don't care about that cost
>as long as the overall results are better). Here's an example:
Yes, i did it. i wrote a PL/pgSQL function. Now results come at 100 ms.. :-)
I dont like that method but i have to do it for perfomance....
Many thanks to everyone who helps...
Adnan DURSUN
ASRIN Bilisim Ltd.
Ankara /TURKEY
---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: a_dursun@hotmail.com
Subject: Re: SQL Function Performance
In-Reply-To: <BAY106-DAV244F7CACF7398D74C15861FA060@phx.gbl>
References: <BAY106-DAV244F7CACF7398D74C15861FA060@phx.gbl>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox