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
Дата
Msg-id
CAApHDvpKHEZXVDsaAyJ9pAkX3KH34jC83spXPjJPyrtrsKk_HA@mail.gmail.com
Ответ на
Re: BUG #19533: Wrong results from WindowAgg run-condition pushdown on count() with EXCLUDE CURRENT ROW (Chengpeng Yan)
Список
Дерево обсуждения
BUG #19533: Wrong results from WindowAgg run-condition pushdown on count() with EXCLUDE CURRENT ROW PG Bug reporting form <noreply@postgresql.org>
Re: BUG #19533: Wrong results from WindowAgg run-condition pushdown on count() with EXCLUDE CURRENT ROW Chengpeng Yan <chengpeng_yan@outlook.com>
Re: BUG #19533: Wrong results from WindowAgg run-condition pushdown on count() with EXCLUDE CURRENT ROW Richard Guo <guofenglinux@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 по дате отправления
От: Richard Guo
Дата:
От: Konstantin Knizhnik
Дата: