Re: How to restore a Plan from a stored plan text?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: How to restore a Plan from a stored plan text?
Дата
Msg-id 16541.1283616618@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: How to restore a Plan from a stored plan text?  (sunpeng <bluevaley@gmail.com>)
Список pgsql-general
sunpeng <bluevaley@gmail.com> writes:
> Thanks for your help!The motivation is that I try to find the most used sub
> plan ,and cach the sub plan's execution result and  store sub plan itself on
> disk. Even the sub plan's connection is closed, the consequent connection
> with the same sub plan could utilize the stored cached result.

This is not particularly a good idea, at least not without a whole lot
of *other* infrastructure.  How will you know if the plan has been
obsoleted by table changes?  Even without considering that, how will you
know when the cached result is obsoleted by data changes?

You might want to consult the PG archives for previous discussions about
shared plan caches.  I think the previous proposals involved keeping
things in shared memory not on disk, but they otherwise had many of the
same problems as this.  There have also been periodic discussions about
caching function execution results, which also seems closely related.

            regards, tom lane

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

Предыдущее
От: Devrim GÜNDÜZ
Дата:
Сообщение: Re: On-disk size of db increased after restore
Следующее
От: Julia Jacobson
Дата:
Сообщение: psql '\copy' command for writing binary data from BYTEA column to file