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

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: Andrei Lepikhov <lepihov(at)gmail(dot)com>
Cc: Richard Guo <guofenglinux(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-04 23:41:13
Message-ID: CAPpHfduu=L-KW65rzjATySgUFh0-smBjj8PSQ_=pb-ayD9Gzjg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Nov 4, 2025 at 3:43 PM Andrei Lepikhov <lepihov(at)gmail(dot)com> wrote:
> On 4/11/2025 08:44, Richard Guo wrote:
> > Any thoughts?The first patch looks good, but I still have a couple of questions.
> 1. We don't use parameterised paths in MergeAppend yet. I wonder if it
> could be nudged by spreading the use of partitioned tables with foreign
> partitions. Do you think, in such a case, the usage of
> cheapest_total->rows will stay correct? It seems that the parameterised
> path has much less estimation than the RelOptInfo...
>
> 2. I understand why the upper relation has unset nrows. However, it may
> be more accurate to set row estimation for a pushing-down upper
> RelOptInfo. Or, at least, describe in comments why this is desirable
> behaviour. It would be profitable, at least, for extension developers.

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.

> I also support the second patch. With many partitions, it allows us to
> save a significant amount of CPU cycles.

+1

------
Regards,
Alexander Korotkov
Supabase

Attachment Content-Type Size
v3-0001-Fix-assertion-failure-in-generate_orderedappend_p.patch application/octet-stream 6.1 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Richard Guo 2025-11-05 01:36:38 Re: BUG #19102: Assertion failure in generate_orderedappend_paths with aggregate pushdown
Previous Message Jeff Davis 2025-11-04 19:20:38 Re: ALTER TABLE ... ADD COLUMN ... DEFAULT with volatile function loses DML