public inbox for [email protected]  
help / color / mirror / Atom feed
From: Richard Guo <[email protected]>
To: Chengpeng Yan <[email protected]>
Cc: [email protected] <[email protected]>
Cc: [email protected] <[email protected]>
Cc: David Rowley <[email protected]>
Subject: Re: BUG #19533: Wrong results from WindowAgg run-condition pushdown on count() with EXCLUDE CURRENT ROW
Date: Mon, 29 Jun 2026 09:39:20 +0900
Message-ID: <CAMbWs4-6umOecRifmC88RW0SHWDAvb4c3-VD8XQ3NJufsUyUOQ@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>

On Sun, Jun 28, 2026 at 1:53 AM Chengpeng Yan <[email protected]> wrote:
> The attached patch takes the conservative route: int8inc_support() no
> longer reports count() as monotonic when the window frame has
> FRAMEOPTION_EXCLUSION. The added regression tests cover the reported
> case, related EXCLUDE variants, and a count(*) case. They also check
> that the excluded-frame query keeps a normal Filter instead of a
> WindowAgg Run Condition.

I think the fix is on the right track.  One nit is that it might be
better to use if/else if structure here.  The other nit is that the
test case is over-heavy; it should be kept as minimal as possible.

> Thoughts welcome on whether this is the right boundary, or whether some
> narrower excluded-frame cases should still prove monotonicity
> separately.

I wonder if we should still support count(*) with EXCLUDE CURRENT ROW,
as that always removes exactly one row, so it is still monotonic.

+   if ((frameOptions & FRAMEOPTION_EXCLUSION) &&
+       ((frameOptions & FRAMEOPTION_EXCLUSION) !=
FRAMEOPTION_EXCLUDE_CURRENT_ROW ||
+        req->window_func->winfnoid != F_COUNT_))
+       monotonic = MONOTONICFUNC_NONE;

- Richard






view thread (15+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: BUG #19533: Wrong results from WindowAgg run-condition pushdown on count() with EXCLUDE CURRENT ROW
  In-Reply-To: <CAMbWs4-6umOecRifmC88RW0SHWDAvb4c3-VD8XQ3NJufsUyUOQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox