Re: Partial aggregates pushdown

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Partial aggregates pushdown
Дата
Msg-id CA+TgmobQeKf0-z0gMEiMB90yToRrhy0f8dO8G19qFsX78vqxRw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Partial aggregates pushdown  (Alexander Pyhalov <a.pyhalov@postgrespro.ru>)
Список pgsql-hackers
On Wed, Nov 22, 2023 at 1:32 AM Alexander Pyhalov
<a.pyhalov@postgrespro.ru> wrote:
> Hi. HAVING is also a problem. Consider the following query
>
> SELECT count(a) FROM t HAVING count(a) > 10 - we can't push it down to
> foreign server as HAVING needs full aggregate result, but foreign server
> don't know it.

I don't see it that way. What we would push to the foreign server
would be something like SELECT count(a) FROM t. Then, after we get the
results back and combine the various partial counts locally, we would
locally evaluate the HAVING clause afterward. That is, partial
aggregation is a barrier to pushing down HAVING clause itself, but it
doesn't preclude pushing down the aggregation.

--
Robert Haas
EDB: http://www.enterprisedb.com



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

Предыдущее
От: Jeremy Schneider
Дата:
Сообщение: proposal: change behavior on collation version mismatch
Следующее
От: Nathan Bossart
Дата:
Сообщение: Re: Do away with a few backwards compatibility macros