Re: Reusing cached prepared statement slow after 5 executions

From: Rob Gansevles <rgansevles(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Reusing cached prepared statement slow after 5 executions
Date: 2011-06-27 06:50:45
Message-ID: BANLkTik3cPr7LLr1x1Da412CUfD53rdTwA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I can confirm, when I call ps.setPrepareThreshold(1) the query is slow
immediately, so the plan must be different with the server prepared
statements.

Thanks,

Rob

On Sun, Jun 26, 2011 at 5:11 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> David Johnston <polobo(at)yahoo(dot)com> writes:
>> This is likely the case where the first few "prepared statements" are
>> not truly prepared.  Once you hit five the cache kicks in and computes
>> a generic query plan to cache.
>
> Not so much that as that JDBC decides that it should tell the backend to
> start using a prepared plan.  See the JDBC docs.
>
>                        regards, tom lane
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Heikki Linnakangas 2011-06-27 07:06:52 Anyone using silent_mode?
Previous Message Tom Lane 2011-06-27 04:02:59 Re: Retrieving the original table of a tuple stored in a tuplestore?