HAVING push-down

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема HAVING push-down
Дата
Msg-id 1169819613.3772.329.camel@silverbirch.site
обсуждение исходный текст
Ответы Re: HAVING push-down  (Gregory Stark <stark@enterprisedb.com>)
Re: HAVING push-down  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
I've just read a paper that says PostgreSQL doesn't do this. My reading
of the code is that we *do*  evaluate the HAVING clause prior to
calculating the aggregates for it. I thought I'd check to resolve the
confusion.

- - -

If not, it seems fairly straightforward to push down some or all of a
HAVING clause so that the qual clause is tested prior to aggregation,
not after aggregation. This could, for certain queries, significantly
reduce the amount of effort that the final Agg node performs.

We might think about deeper push-down within the query, but since the
Agg node already has the havingQual, it seems a straightforward act to
decide whether to apply it before or after the aggregation.

We already do find_unaggregated_cols(), so little additional analysis
seems required.

--  Simon Riggs              EnterpriseDB   http://www.enterprisedb.com




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

Предыдущее
От: Jan Wieck
Дата:
Сообщение: Re: Proposal: Commit timestamp
Следующее
От: "Greg Sabino Mullane"
Дата:
Сообщение: Re: [pgsql-patches] pg_dump pretty_print