Re: MergeAppend could consider sorting cheapest child path

From: Andrei Lepikhov <lepihov(at)gmail(dot)com>
To: Alexander Pyhalov <a(dot)pyhalov(at)postgrespro(dot)ru>
Cc: Andy Fan <zhihuifan1213(at)163(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Alexander Korotkov <aekorotkov(at)gmail(dot)com>, Nikita Malakhov <HukuToc(at)gmail(dot)com>
Subject: Re: MergeAppend could consider sorting cheapest child path
Date: 2025-05-05 11:38:39
Message-ID: ebb22581-e4c5-4ea3-90ac-dbbcb3020529@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 4/29/25 19:25, Alexander Pyhalov wrote:
> Andrei Lepikhov писал(а) 2025-04-29 16:52:
> But it seems, base_path can't be NULL
Correct. Fixed.

>
> Also we check base_path for required_outer and require_parallel_safe,
> but if cheapest path for pathkeys is NULL, these checks are not
> performed.
Thanks. Fixed.

> Luckily, they seen to be no-op anyway due to cheapest_total- >
>param_info == NULL and function arguments being NULL (required_outer)
> and false (require_parallel_safe). Should we do something about this?
> Don't know, perhaps, remove these misleading arguments?
The main reason why I introduced these _ext routines was that this
schema may be used somewhere else. And in that case parameterised paths
may exist. Who knows, may be parameterised paths will be introduced for
merge append too?

> become no-op? And we do return non-null path from
> get_cheapest_fractional_path_for_pathkeys_ext(), as it seems we return
> either cheapest_total_path or cheapest fractional path from
> get_cheapest_fractional_path_for_pathkeys_ext().
Ok.

Let's check next version of the patch in the attachment.

--
regards, Andrei Lepikhov

Attachment Content-Type Size
v2-0001-Consider-explicit-sort-of-the-MergeAppend-subpath.patch text/x-patch 28.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrei Lepikhov 2025-05-05 11:41:17 Re: MergeAppend could consider sorting cheapest child path
Previous Message Yura Sokolov 2025-05-05 11:15:15 Re: Fix a race condition in ConditionVariableTimedSleep()