Re: Prepared Statements
От | Isak Hansen |
---|---|
Тема | Re: Prepared Statements |
Дата | |
Msg-id | 6b9e1eb20801100412w6f951dd6y9de1e39a0c5805a8@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Prepared Statements (mljv@planwerk6.de) |
Список | pgsql-general |
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
В списке pgsql-general по дате отправления: