Re: window function induces full table scan

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: window function induces full table scan
Дата
Msg-id 18380.1388702592@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: window function induces full table scan  (Jeff Janes <jeff.janes@gmail.com>)
Ответы Re: window function induces full table scan  (Thomas Mayer <thomas.mayer@student.kit.edu>)
Re: window function induces full table scan  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
Jeff Janes <jeff.janes@gmail.com> writes:
> On Thu, Jan 2, 2014 at 1:52 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> It's possible that in the specific case you exhibit here, pushing down
>> the clause wouldn't result in changes in the window function's output for
>> the selected rows, but the optimizer doesn't have enough knowledge about
>> window functions to determine that.

> A restriction in the WHERE clause which corresponds to the PARTITION BY
> should be pushable, no?  I think it doesn't need to understand the internal
> semantics of the window function itself, just of the PARTITION BY, which
> should be doable, at least in principle.

If the restriction clause must give the same answer for any two rows of
the same partition, then yeah, we could in principle push it down without
knowing anything about the specific window function.  It'd be a less than
trivial test to make, I think.  In any case, it's not a "bug" that the
optimizer doesn't do this currently.

            regards, tom lane


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

Предыдущее
От: Jeff Janes
Дата:
Сообщение: Re: window function induces full table scan
Следующее
От: Thomas Mayer
Дата:
Сообщение: Re: window function induces full table scan