pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Isak Hansen <isak.hansen@gmail.com>
To: mljv@planwerk6.de <mljv@planwerk6.de>
Cc: Kris Jurka <books@ejurka.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Prepared Statements
Date: Thu, 10 Jan 2008 13:12:03 +0100
Message-ID: <6b9e1eb20801100412w6f951dd6y9de1e39a0c5805a8@mail.gmail.com> (raw)
In-Reply-To: <200801101153.38782.mljv@planwerk6.de>
References: <200801092002.15417.mljv@planwerk6.de>
	<Pine.BSO.4.64.0801091507500.27353@leary.csoft.net>
	<200801101153.38782.mljv@planwerk6.de>

On 1/10/08, mljv@planwerk6.de <mljv@planwerk6.de> 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



view thread (19+ messages)  latest in thread

Message-ID: <6b9e1eb20801100412w6f951dd6y9de1e39a0c5805a8@mail.gmail.com>
Permalink:  ../6b9e1eb20801100412w6f951dd6y9de1e39a0c5805a8@mail.gmail.com/
Also on:    postgresql.org/message-id/6b9e1eb20801100412w6f951dd6y9de1e39a0c5805a8@mail.gmail.com

 · 

reply

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-general@postgresql.org
  Cc: isak.hansen@gmail.com, mljv@planwerk6.de, books@ejurka.com
  Subject: Re: Prepared Statements
  In-Reply-To: <6b9e1eb20801100412w6f951dd6y9de1e39a0c5805a8@mail.gmail.com>
  References: <200801092002.15417.mljv@planwerk6.de> <Pine.BSO.4.64.0801091507500.27353@leary.csoft.net> <200801101153.38782.mljv@planwerk6.de> <6b9e1eb20801100412w6f951dd6y9de1e39a0c5805a8@mail.gmail.com>

* 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