From: | Alexander Korotkov <aekorotkov(at)gmail(dot)com> |
---|---|
To: | Andrei Lepikhov <lepihov(at)gmail(dot)com> |
Cc: | Alexander Pyhalov <a(dot)pyhalov(at)postgrespro(dot)ru>, Andy Fan <zhihuifan1213(at)163(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Nikita Malakhov <HukuToc(at)gmail(dot)com> |
Subject: | Re: MergeAppend could consider sorting cheapest child path |
Date: | 2025-09-07 11:26:17 |
Message-ID: | CAPpHfdsn_mPy1v6Gf8rmdkBDsDLU+=J4M4sBzgaFv21cWruZFA@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Fri, Sep 5, 2025 at 11:45 AM Andrei Lepikhov <lepihov(at)gmail(dot)com> wrote:
>
> On 1/9/2025 22:26, Alexander Korotkov wrote:
> > On Thu, Jul 31, 2025 at 5:20 PM Andrei Lepikhov <lepihov(at)gmail(dot)com> wrote:
> >> See this minor correction in the attachment. postgres_fdw tests are
> >> stable now.
> >
> > I have another idea. What if we allow MergeAppend paths only when at
> > least one subpath is preordered. This trick also allow us to exclude
> > MergeAppend(Sort) dominating Sort(Append). I see the regression tests
> > changes now have much less volume and looks more reasonable. What do
> > you think?
> I believe a slight mistake has been made with the total_has_ordered /
> startup_has_ordered parameters, which has caused unnecessary test
> changes in inherit.out (See updated patch in the attachment). Although
> not the best test in general (it depends on the autovacuum), it
> highlighted the case where a startup-optimal strategy is necessary, even
> when a fractional-optimal path is available, which may lead to continue
> of the discussion [1].>
> > Also, do you think get_cheapest_fractional_path_for_pathkeys_ext() and
> > get_cheapest_path_for_pathkeys_ext() should consider incremental sort?
> > The revised patch teaches them to do so.
> Following 55a780e9476 [2] it should be considered, of course.
Great, thank you for catching this. The diff of costs is attached. I
see the costs now are better or within the fuzz factor.
------
Regards,
Alexander Korotkov
Supabase
Attachment | Content-Type | Size |
---|---|---|
costs.diff | application/octet-stream | 22.4 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Sergey Fukanchik | 2025-09-07 14:00:56 | Re: [PATCH] Perform check for oversized WAL record before calculating record CRC |
Previous Message | Junwang Zhao | 2025-09-07 11:11:52 | Re: Reduce "Var IS [NOT] NULL" quals during constant folding |