Vacuum, statistics, & trigger/procedure query plan caching

From: "Karl O(dot) Pinc" <kop(at)meme(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Vacuum, statistics, & trigger/procedure query plan caching
Date: 2005-04-04 15:15:29
Message-ID: 1112627729l.25286l.0l@mofo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

IIRC I once figured out that, for triggers at least,
query plans are cached with the connection.
This means that vacuuming and thus alterations
in the statistics do not take effect until
a connection is broken and re-established.

Mostly. At least for triggers. I think.
(In 7.4?)

I can't seem to find documentation on the
caching of query plans. And in any case
it would be nice to have that information
linked to from the "periodic database maintenance
tasks" page that explains vacuuming.

Would it be possible/sensible to put a timestamp
on the cached query plans and compare that with
a timestamp on the last vacuum of the relevant
tables so that the query plans can be regenerated
if done from out of date statistics?
(Might that make it possible to plan queries less
often by disassociating the trigger query plan cache
from the connection?)

Out of date query plans don't often matter
but when they do they matter a lot.

Regards,

Karl <kop(at)meme(dot)com>
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein

Browse pgsql-general by date

  From Date Subject
Next Message Michelle Konzack 2005-04-04 15:20:06 Re: How to query pgsql from a BASH script ?
Previous Message Tom Lane 2005-04-04 15:14:02 Re: field definitions in view results?