Re: Prepared statements considered harmful

Поиск
Список
Период
Сортировка
От Jeroen T. Vermeulen
Тема Re: Prepared statements considered harmful
Дата
Msg-id 23335.125.24.240.23.1157124367.squirrel@webmail.xs4all.nl
обсуждение исходный текст
Ответ на Re: Prepared statements considered harmful  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Fri, September 1, 2006 21:30, Tom Lane wrote:

> Yeah.  One of the reasons the planner is acceptably fast is that it is
> aggressive about discarding candidate plans as soon as they are clearly
> inferior to other plans.  Tracking multiple plans that might be optimal
> under varying assumptions about the query parameters would make things
> exponentially slower.

AFAICS the planner shouldn't be affected at all--it'd just be invoked more
often as and when the need for new plans became apparent.  Not
"exponentially" (that's an overused word anyway) but "proportionally" to
that.

I've been assuming that once you have a plan, storing it is not very
expensive.  If, say, doubling the number of plans stored with a session's
prepared statements incurs some serious cost (apart from the planning
itself, of course) then that changes things.


Jeroen




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

Предыдущее
От: Gregory Stark
Дата:
Сообщение: Re: Prepared statements considered harmful
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Prepared statements considered harmful