Re: BUG #19102: Assertion failure in generate_orderedappend_paths with aggregate pushdown - Mailing list pgsql-bugs

From Richard Guo
Subject Re: BUG #19102: Assertion failure in generate_orderedappend_paths with aggregate pushdown
Date
Msg-id CAMbWs49GqiLdhH77BPHfqE+7KGN2H67pvKamYWeVKGZv_iPLZQ@mail.gmail.com
Whole thread Raw
In response to Re: BUG #19102: Assertion failure in generate_orderedappend_paths with aggregate pushdown  (Alexander Korotkov <aekorotkov@gmail.com>)
Responses Re: BUG #19102: Assertion failure in generate_orderedappend_paths with aggregate pushdown
List pgsql-bugs
On Wed, Nov 5, 2025 at 8:41 AM Alexander Korotkov <aekorotkov@gmail.com> wrote:
> I wonder if get_cheapest_fractional_path_for_pathkeys() should start
> the same as get_cheapest_fractional_path() with calculation of the
> tuple fraction.  We could change its first argument to RelOptInfo,
> since the both callers get pathlist from RelOptInfo.  See attached
> draft patch implementing this.

No, I don't think your patch is correct.  With your changes, the
meaning of the fraction parameter in
get_cheapest_fractional_path_for_pathkeys() becomes quite ambiguous.

In the build_minmax_path() case, this parameter represents the
fraction of tuples we want to retrieve, and thus converting the
fraction again within get_cheapest_fractional_path_for_pathkeys() is
incorrect.  However, in the generate_orderedappend_paths() case, the
parameter is interpreted the same way as in grouping_planner().  I
don't think it's a good design choice for the same function parameter
to be interpreted differently depending on where it is called.

In addition, your patch doesn't update this function's comment to
provide a correct explanation of the fraction parameter.

- Richard



pgsql-bugs by date:

Previous
From: Alexander Korotkov
Date:
Subject: Re: BUG #19102: Assertion failure in generate_orderedappend_paths with aggregate pushdown
Next
From: Michael Paquier
Date:
Subject: Re: BUG #19093: Behavioral change in walreceiver termination between PostgreSQL 14.17 and 14.18