Re: Prepared statements considered harmful

Поиск
Список
Период
Сортировка
От Zeugswetter Andreas DCP SD
Тема Re: Prepared statements considered harmful
Дата
Msg-id E1539E0ED7043848906A8FF995BDA579014DBDAF@m0143.s-mxs.net
обсуждение исходный текст
Ответ на Re: Prepared statements considered harmful  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
> > How about "prepared" means really "prepared"... in the sense of
> > parsed, analyzed all sensible plans, and save a meta-plan which
based
> > on current statistics and parameter values chooses one of the
> > considered (and cached) plans ?
>
> I don't think this could solve one particularly frequent
> problem which is that pattern matching queries don't get
> along with prepared plans if the search pattern isn't known
> at planning time.

I think what we would actually want is knowledge about how
much difference different parameters actually make in plan decision.
(the stats show an even distribution and join correlation)
Then we could prepare the plan when there is not much difference
and postpone planning until we know the parameters when the difference
is big.

OLTP workload typically benefits from prepared plans, and the one plan
is good
for all possible inputs, so imho we cannot just assume all plans need
replanning
for different parameters.

Andreas


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Prepared statements considered harmful
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Prepared statements considered harmful