From: Arne Roland <A.Roland@index.de>
To: Tomas Vondra <tomas.vondra@enterprisedb.com>
To: Zhihong Yu <zyu@yugabyte.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: PATCH: generate fractional cheapest paths in generate_orderedappend_path
Date: Fri, 4 Jun 2021 00:10:25 +0000
Message-ID: <920f0b3b5761410ab6833787211af250@index.de> (raw)
In-Reply-To: <a4725936-8e2c-91e7-8b81-e27c961a763e@enterprisedb.com>
References: <e8f9ec90-546d-e948-acce-0525f3e92773@enterprisedb.com>
<a4725936-8e2c-91e7-8b81-e27c961a763e@enterprisedb.com>
Hi,
thanks for the quick reply!
From: Tomas Vondra <tomas.vondra@enterprisedb.com>
Sent: Thursday, June 3, 2021 20:11
To: Arne Roland; pgsql-hackers
Subject: Re: PATCH: generate fractional cheapest paths in generate_orderedappend_path
> I haven't tested the parallel case, but I think we should sort out (3)
> get_cheapest_fractional_path_for_pathkeys as mentioned above.
>
Not sure what you refer to by "above" - it's probably better to reply
in-line to existing message, which makes it much cleared.
I was referring to one message above. I thought the thread was still short enough. Apparently to much time has passed. Sorry, I hope this mail is better. I was referring to my post from April:
________________________________
From: Arne Roland
Sent: Monday, April 26, 2021 13:00
To: Tomas Vondra; pgsql-hackers
Subject: Re: PATCH: generate fractional cheapest paths in generate_orderedappend_path
>3) Not sure if get_cheapest_fractional_path_for_pathkeys should worry
> about require_parallel_safe, just like the other functions nearby.
I think it should. We have a ParallelAppend node after all.
I'm not really familiar with the way get_cheapest_fractional_path_for_pathkeys is used, but a quick search suggests to me, that build_minmax_path was thus far the only one using it. And minmax paths are never parallel safe anyway. I think that is the reason it doesn't do that already.
________________________________
From: Zhihong Yu <zyu@yugabyte.com>
Sent: Thursday, June 3, 2021 22:50
To: Tomas Vondra
Cc: Arne Roland; pgsql-hackers
Subject: Re: PATCH: generate fractional cheapest paths in generate_orderedappend_path
Hi,
In REL_11_STABLE branch, a search revealed the following:
src/backend/optimizer/path/pathkeys.c: * get_cheapest_fractional_path_for_pathkeys
src/backend/optimizer/path/pathkeys.c:get_cheapest_fractional_path_for_pathkeys(List *paths,
src/backend/optimizer/plan/planagg.c: get_cheapest_fractional_path_for_pathkeys(final_rel->pathlist,
src/include/optimizer/paths.h:extern Path *get_cheapest_fractional_path_for_pathkeys(List *paths,
It seems this function has been refactored out in subsequent releases.
FYI
Thanks for the info!
I doubt there is any interest to back patch this anywhere. My most ambitious dream would be getting this into pg 14.
I think, we only care about a parallel safety aware variant anyways, which afaict never existed.
________________________________
From: Tomas Vondra <tomas.vondra@enterprisedb.com>
Sent: Thursday, June 3, 2021 22:57
To: Zhihong Yu
Cc: Arne Roland; pgsql-hackers
Subject: Re: PATCH: generate fractional cheapest paths in generate_orderedappend_path
Actually, there are two comments
/* XXX maybe we should have startup_new_fractional? */
in the patch I posted - I completely forgot about that. But I think
that's a typo, I think - it should be
/* XXX maybe we should have startup_neq_fractional? */
and the new flag would work similarly to startup_neq_total, i.e. it's
pointless to add paths where startup == fractional cost.
At least I think that was the idea when I wrote the patch, it way too
long ago.
Sorry, I almost forgot about this myself. I only got reminded upon seeing that again with different queries/tables.
Just to be sure I get this correctly: You mean startup_gt_fractional (cost) as an additional condition, right?
Regards
Arne
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: A.Roland@index.de, tomas.vondra@enterprisedb.com, zyu@yugabyte.com
Subject: Re: PATCH: generate fractional cheapest paths in generate_orderedappend_path
In-Reply-To: <920f0b3b5761410ab6833787211af250@index.de>
References: <e8f9ec90-546d-e948-acce-0525f3e92773@enterprisedb.com> <a4725936-8e2c-91e7-8b81-e27c961a763e@enterprisedb.com> <920f0b3b5761410ab6833787211af250@index.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox