Re: BUG #19102: Assertion failure in generate_orderedappend_paths with aggregate pushdown

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
Cc: Andrei Lepikhov <lepihov(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org, akorotkov(at)postgresql(dot)org, Kuntal Ghosh <kuntalghosh(dot)2007(at)gmail(dot)com>
Subject: Re: BUG #19102: Assertion failure in generate_orderedappend_paths with aggregate pushdown
Date: 2025-11-05 01:36:38
Message-ID: CAMbWs49GqiLdhH77BPHfqE+7KGN2H67pvKamYWeVKGZv_iPLZQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, Nov 5, 2025 at 8:41 AM Alexander Korotkov <aekorotkov(at)gmail(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2025-11-05 01:46:24 Re: BUG #19093: Behavioral change in walreceiver termination between PostgreSQL 14.17 and 14.18
Previous Message Alexander Korotkov 2025-11-04 23:41:13 Re: BUG #19102: Assertion failure in generate_orderedappend_paths with aggregate pushdown