Re: Bug in row_number() optimization - Mailing list pgsql-hackers

From Richard Guo
Subject Re: Bug in row_number() optimization
Date
Msg-id CAMbWs4-8UnEWbb8t-mqD0oSSUF_6eK7++BkzaEED8kCvN7g90Q@mail.gmail.com
Whole thread Raw
In response to Re: Bug in row_number() optimization  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: Bug in row_number() optimization
List pgsql-hackers

On Fri, Nov 25, 2022 at 7:34 AM David Rowley <dgrowleyml@gmail.com> wrote:
Since upper-level WindowAggs cannot reference values calculated in
some lower-level WindowAgg, why can't we just NULLify the pointers
instead? See attached.
 
Verified the problem is fixed with this patch.  I'm not familiar with
the WindowAgg execution codes.  As far as I understand, this patch works
because we set ecxt_aggnulls to true, making it a NULL value.  And the
top-level WindowAgg node's "Filter" is strict so that it can filter out
all the tuples that don't match the intermediate WindowAgg node's run
condition.  So I find the comments about "WindowAggs above us cannot
reference the result of another WindowAgg" confusing.  But maybe I'm
missing something.

Thanks
Richard

pgsql-hackers by date:

Previous
From: Peter Smith
Date:
Subject: Re: Perform streaming logical transactions by background workers and parallel apply
Next
From: Dilip Kumar
Date:
Subject: Re: Patch: Global Unique Index