Re: Delaying the planning of unnamed statements until Bind

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Delaying the planning of unnamed statements until Bind
Дата
Msg-id 17475.1086916779@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Delaying the planning of unnamed statements until Bind  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Delaying the planning of unnamed statements until Bind  (Oliver Jowett <oliver@opencloud.com>)
Список pgsql-hackers
I've applied the patch you sent in for this, with some editorializations
--- you were being too aggressive about substituting constants, with the
net effect that the plan was not still parameterized as it was supposed
to be.

I realized along the way that what we're really doing here is inventing
a notion of constant-folding expressions "for estimation purposes only".
As such, we don't have to be as rigid about making only provably safe
transformations as eval_const_expressions normally has to be.  I didn't
do anything with the idea yet, but I'd like to look into having this
mode do more than just substitute Param values.  An example that's been
causing us trouble for a long while is that the planner can't make any
nondefault selectivity estimate forSELECT ... WHERE timestampcol > now() - '1 day';
because eval_const_expressions dare not reduce now() to current time.
But I think it would be entirely reasonable to do so "for estimation
purposes".
        regards, tom lane


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Nested xacts: looking for testers and review
Следующее
От: Christopher Kings-Lynne
Дата:
Сообщение: Re: [COMMITTERS] pgsql-server: Clean up generation of default names