Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id C6C616339C8; Mon, 9 Mar 2009 16:57:14 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 90191-02; Mon, 9 Mar 2009 16:57:05 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.25]) by mail.postgresql.org (Postfix) with ESMTP id 138EC6334D6; Mon, 9 Mar 2009 16:57:05 -0300 (ADT) Received: by qw-out-2122.google.com with SMTP id 5so904368qwd.61 for ; Mon, 09 Mar 2009 12:57:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type; bh=gSqGqWUwJUi60dvjij/g+IKkX8W24vPULcFPfL8rjZQ=; b=YYzVi9UzlOqCme1cZAVWuVHxyv/ACD2C6w+NRO3DazTv2n/FHxaj6XyW1pDftI7k6l efeAAA3LREpH4jKjfYHLBfFHmHhaj2UxizSMIEJfS5CO45k37efVVq/Fi7Ht5lAcH1m5 quarrKHaIXoilMPRQEjr/fyG71BdaYPO+HnKs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=Z149+5Ipe6KgZc1WIkQW34YpuIKYHKnuamopCMnkRTvEIWsgBg7ipkN+VfPds5i7Ed 5AxVm5FhSTnel2NZ549ReLgNAo8NqBxcAMatxrwFTbRKIfbYxsMI+rdS3x3Tr2xpindB CsBZg4ryWE6jGAgr5YBXwFxYDPCi45gtgvDpI= MIME-Version: 1.0 Received: by 10.229.82.76 with SMTP id a12mr3535752qcl.7.1236628613749; Mon, 09 Mar 2009 12:56:53 -0700 (PDT) In-Reply-To: <5165.1236618994@sss.pgh.pa.us> References: <49B51B60.6030600@megafon.hr> <27649.1236616294@sss.pgh.pa.us> <87fxhmmygj.fsf@meuh.mnc.lan> <1d4e0c10903091004m758d7ea2s91e33631be81215a@mail.gmail.com> <5165.1236618994@sss.pgh.pa.us> Date: Mon, 9 Mar 2009 15:56:53 -0400 X-Google-Sender-Auth: 950f3964182531f9 Message-ID: <491f66a50903091256n7fe4a3f6i93267d0d53b983cb@mail.gmail.com> Subject: Re: [PERFORM] Query much slower when run from postgres function From: Dave Cramer To: Tom Lane Cc: Guillaume Smet , Guillaume Cottenceau , Mario Splivalo , pgsql-performance@postgresql.org, pgsql-jdbc@postgresql.org Content-Type: multipart/alternative; boundary=0016364ee0683f01b70464b5096a X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200903/33 X-Sequence-Number: 19363 --0016364ee0683f01b70464b5096a Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Mon, Mar 9, 2009 at 1:16 PM, Tom Lane wrote: > Guillaume Smet writes: > > Unnamed prepared statements are planned after binding the values, > > starting with 8.3, or more precisely starting with 8.3.2 as early 8.3 > > versions were partially broken on this behalf. > > No, 8.2 did it too (otherwise we wouldn't have considered 8.3.0 to be > broken...). The thing I'm not too clear about is what "use of an > unnamed statement" translates to for a JDBC user. > Tom, The driver will use unnamed statements for all statements until it sees the same statement N times where N is 5 I believe, after that it uses a named statement. Dave --0016364ee0683f01b70464b5096a Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Mon, Mar 9, 2009 at 1:16 PM, Tom Lane= <tgl@sss.pgh.pa.= us> wrote:
Guillaume Smet <guillaume.smet@gmail.com> writes:
> Unnamed prepared statements are planned after binding the values,
> starting with 8.3, or more precisely starting with 8.3.2 as early 8.3<= br> > versions were partially broken on this behalf.

No, 8.2 did it too (otherwise we wouldn't have considered 8.3.0 t= o be
broken...). =A0The thing I'm not too clear about is what "use of a= n
unnamed statement" translates to for a JDBC user.

Tom,

The driver will use unnamed statements fo= r all statements until it sees the same statement N times where N is 5 I be= lieve, after that it uses a named statement.

Dave

--0016364ee0683f01b70464b5096a--