Re: Prepared Statements - Mailing list pgsql-general

From Tom Lane
Subject Re: Prepared Statements
Date
Msg-id 24034.1200181610@sss.pgh.pa.us
Whole thread Raw
In response to Re: Prepared Statements  (Kris Jurka <books@ejurka.com>)
Responses Re: Prepared Statements  (Janning Vygen <vygen@planwerk6.de>)
List pgsql-general
Kris Jurka <books@ejurka.com> writes:
> On Thu, 10 Jan 2008, mljv@planwerk6.de wrote:
>> 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?

> Data and stats changes do not trigger a replan.

Note that this is no longer true as of 8.3: a stats update from ANALYZE
(either manual or autovacuum) will trigger invalidation of cached plans.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Possible bug in PostgreSQL 8.3beta4 (postgres process segfaults)
Next
From: "Rodrigo E. De León Plicet"
Date:
Subject: Re: UPDATE .. JOIN?