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

From: Chengpeng Yan <chengpeng_yan(at)outlook(dot)com>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: John Naylor <johncnaylorls(at)gmail(dot)com>, Richard Guo <guofenglinux(at)gmail(dot)com>, "imchifan(at)163(dot)com" <imchifan(at)163(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #19533: Wrong results from WindowAgg run-condition pushdown on count() with EXCLUDE CURRENT ROW
Date: 2026-07-06 08:31:42
Message-ID: CA22A3A0-3ADC-413B-8A91-683E20497E2E@outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi David,

> On Jul 6, 2026, at 15:24, David Rowley <dgrowleyml(at)gmail(dot)com> wrote:`
>
> 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.

Thanks for updating the patch. I looked through the code and it looks
good to me.

One minor comment: this test comment seems to be a typo:

-- As above, but check we detect it's monotonically increasing

It looks like the following test is checking that we do not treat the
frame as monotonically increasing.

Other than that, LGTM.

--
Best regards,
Chengpeng Yan

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Ayush Tiwari 2026-07-06 11:03:03 Re: REVOKE's CASCADE protection doesn't work with INHERITed table owners
Previous Message David Rowley 2026-07-06 07:24:54 Re: BUG #19533: Wrong results from WindowAgg run-condition pushdown on count() with EXCLUDE CURRENT ROW