Search Postgresql Archives

Re: Prepared Statements

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/10/08, mljv@xxxxxxxxxxxx <mljv@xxxxxxxxxxxx> wrote:
> > >
> > > I have not found anything about preparing "unnamed" statements. What
> > > does it mean?
> >
> > Unnamed statements are what the driver uses before it hits the
> > prepareThreshold limit.  Once it has determined the statement will be
> > reused many times it changes to a named statement that has a longer
> > lifespan.
>
> What do you mean with "longer lifespan"? Doesn't the JDBC driver uses the
> PREPARE Sql Statement and therefore the prepared Statement has the same
> lifespan as the connection? If so, as connections are pooled and never
> closed, the prepared Statement will last forever. What if the table analyzes
> changes and a better execution plan could be found?
>

An unnamed prepared query is just a normal one-shot query, but it
allows the use of bind variables.

You'll find more details in the protocol section of the postgres docs
<http://www.postgresql.org/docs/8.3/static/protocol.html>.


Regards,
Isak

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux