Re: why partition pruning doesn't work?

Поиск
Список
Период
Сортировка
От Ashutosh Bapat
Тема Re: why partition pruning doesn't work?
Дата
Msg-id CAFjFpRfUhpRLy0XipFEZKktUrqiKRYOEUy0xfKvp57Z=zrEYSQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: why partition pruning doesn't work?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Fri, Jun 8, 2018 at 8:52 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> David Rowley <david.rowley@2ndquadrant.com> writes:
>> On 8 June 2018 at 03:43, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> Maybe there's something I'm missing here, but I sort of hoped that this
>>> patch would nuke all the special-case code for Params in this area.
>>> Why is there any need to distinguish them from other stable expressions?
>
>> We need to know which Params exist in the Expr as if there are no
>> Params, or only external Params, then we can run-time prune during
>> startup of the executor.
>
> This does not refute my question.  Why doesn't the same logic apply
> to any stable expression?  That is, ISTM a Param is a special case
> of that.
>

+1.

I don't think we need to perform pruning at the start of execution,
but we could fold all the stable expressions to constants at that
time. The PARAM_EXECs can not be folded into constant at execution
start since those not assigned any values yet. AFAIU expressions,
within a given node, with those parameters can be folded into
constants (if possible) during ExecRewind() on that node. We have to
perform pruning just before the (Merge)Append node scan starts.

-- 
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Performance regression with PostgreSQL 11 and partitioning
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: hot_standby_feedback vs excludeVacuum and snapshots