Re: BUG #19533: Wrong results from WindowAgg run-condition pushdown on count() with EXCLUDE CURRENT ROW

Поиск
Список
Период
Сортировка
Искать
От
David Rowley
Тема
Re: BUG #19533: Wrong results from WindowAgg run-condition pushdown on count() with EXCLUDE CURRENT ROW
Дата
в 10:24:54
Msg-id
CAApHDvpKHEZXVDsaAyJ9pAkX3KH34jC83spXPjJPyrtrsKk_HA@mail.gmail.com
Ответ на
Список
Дерево обсуждения
On Mon, 6 Jul 2026 at 00:54, Chengpeng Yan  wrote:
> count(*) FILTER (WHERE ...)

Yeah, looks like we'll need to disable if there's a FILTER clause.

> int exclusion = frameOptions & FRAMEOPTION_EXCLUSION;
> bool plain_count_star = req->window_func->winfnoid == F_COUNT_ &&
> req->window_func->aggfilter == NULL;
>
> if (exclusion &&
> (exclusion != FRAMEOPTION_EXCLUDE_CURRENT_ROW || !plain_count_star))
> {
> req->monotonic = MONOTONICFUNC_NONE;
> PG_RETURN_POINTER(req);
> }
> ```

Given how complex Claude's logic became to get all those cases
correct, I now think the above is the best option. I've attached a
patch for that.

David
В списке pgsql-bugs по дате отправления
От: Konstantin Knizhnik
Дата:
FAQ