X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 3F8629DC804 for ; Tue, 14 Feb 2006 18:36:09 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 86375-05 for ; Tue, 14 Feb 2006 18:36:10 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from hotmail.com (bay106-dav24.bay106.hotmail.com [65.54.161.96]) by postgresql.org (Postfix) with ESMTP id E135C9DC8A3 for ; Tue, 14 Feb 2006 18:36:06 -0400 (AST) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 14 Feb 2006 14:36:08 -0800 Message-ID: Received: from 85.105.24.123 by BAY106-DAV24.phx.gbl with DAV; Tue, 14 Feb 2006 22:36:08 +0000 X-Originating-IP: [85.105.24.123] X-Originating-Email: [a_dursun@hotmail.com] X-Sender: a_dursun@hotmail.com From: "Adnan DURSUN" To: Subject: Re: SQL Function Performance Date: Wed, 15 Feb 2006 00:35:59 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0003_01C631C7.CAD3D110" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-OriginalArrivalTime: 14 Feb 2006 22:36:08.0928 (UTC) FILETIME=[0CBF5600:01C631B7] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=2.26 required=5 tests=[AWL=0.340, DNS_FROM_RFC_ABUSE=0.479, DNS_FROM_RFC_POST=1.44, HTML_MESSAGE=0.001, MSGID_FROM_MTA_HEADER=0] X-Spam-Score: 2.26 X-Spam-Level: ** X-Archive-Number: 200602/183 X-Sequence-Number: 17169 This is a multi-part message in MIME format. ------=_NextPart_000_0003_01C631C7.CAD3D110 Content-Type: text/plain; charset="iso-8859-9" Content-Transfer-Encoding: quoted-printable -------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=3D5.90..267.19 rows=3D3 width=3D101) = (actual time=3D76.240..30974.777 rows=3D63193 loops=3D1) >> -> Nested Loop (cost=3D5.90..123.48 rows=3D26 = width=3D73) (actual time=3D32.082..4357.786 rows=3D14296 loops=3D1) >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 ------=_NextPart_000_0003_01C631C7.CAD3D110 Content-Type: text/html; charset="iso-8859-9" Content-Transfer-Encoding: quoted-printable
 
 
-------Original = Message-------
 
From: Michael Fuhr
Date: 02/14/06 = 23:05:55
To: Adnan DURSUN
Cc: pgsql-performance@postgr= esql.org
Subject: Re: = [PERFORM] SQL=20 Function Performance
 
>On Tue, Feb 14, 2006 at 11:33:57AM +0200, Adnan DURSUN = wrote:
>>        =20 ->  Nested Loop  (cost=3D5.90..267.19 rows=3D3 = width=3D101)=20 (actual time=3D76.240..30974.777 rows=3D63193 loops=3D1)
>>          =     =20 ->  Nested Loop  (cost=3D5.90..123.48 rows=3D26 = width=3D73)=20 (actual time=3D32.082..4357.786 rows=3D14296 loops=3D1)
 
>Absent a better solution, you could write a PL/pgSQL function = and
>build the query as a text string, then EXECUTE = it.  That=20 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=20 example:
 
    Yes, i did it. i wrote a PL/pgSQL function. Now = results=20 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=20 broadcast)---------------------------
TIP 2: Don't 'kill -9' the = postmaster
------=_NextPart_000_0003_01C631C7.CAD3D110--