Re: generalizing the planner knobs

Поиск
Список
Период
Сортировка
От Pollard, Mike
Тема Re: generalizing the planner knobs
Дата
Msg-id 6418CC03D0FB1943A464E1FEFB3ED46B01B220FC@im01.cincom.com
обсуждение исходный текст
Ответ на generalizing the planner knobs  (Neil Conway <neilc@samurai.com>)
Ответы Re: generalizing the planner knobs  (Simon Riggs <simon@2ndquadrant.com>)
Список pgsql-hackers
Simon Riggs wrote
> ISTM we could do some of that with another GUC, lets call it
> prepare_once = on. The system default is to have a prepared statement
> bound to a plan on its first parameter bind. If we set this to "off",
> then the statement will replan each time we bind. This would give us
> both flexibility and predictability. (As ever, someone suggest a
better
> name?).
>

We call it deferred optimization.

Do you really stop at the first parameter?  What if it couldn't possibly
affect the plan (<col> like '%M%', or <col> is not involved in an
index)?  You can continue to plan up until the first parameter that can
affect the plan.  At that point, you save off the plan, and when you get
actual values (on the execute command), continue with the planning.  You
can do the same thing with correlated subqueries

Mike Pollard
SUPRA Server SQL Engineering and Support
Cincom Systems, Inc.



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Reducing relation locking overhead
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: [PATCHES] snprintf() argument reordering not working