Vacuum, statistics, & trigger/procedure query plan caching

Поиск
Список
Период
Сортировка
От Karl O. Pinc
Тема Vacuum, statistics, & trigger/procedure query plan caching
Дата
Msg-id 1112627729l.25286l.0l@mofo
обсуждение исходный текст
Список 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@meme.com>
Free Software:  "You don't pay back, you pay forward."
                 -- Robert A. Heinlein



В списке pgsql-general по дате отправления:

Предыдущее
От: Wes
Дата:
Сообщение: Re: Vacuum time degrading
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Vacuum time degrading