Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1loxQ4-0003I0-9i for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Jun 2021 00:10:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1loxQ3-00069g-9M for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Jun 2021 00:10:35 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1loxQ2-00069X-NV for pgsql-hackers@lists.postgresql.org; Fri, 04 Jun 2021 00:10:35 +0000 Received: from mxout1.routing.net ([2a03:2900:1:a::a]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1loxPz-0000b8-5i for pgsql-hackers@postgresql.org; Fri, 04 Jun 2021 00:10:33 +0000 Received: from mxbox1.masterlogin.de (unknown [192.168.10.88]) by mxout1.routing.net (Postfix) with ESMTP id B82EB40116; Fri, 4 Jun 2021 00:10:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1622765426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=sNNcGOWiul3Pae80dG+gejivUw+DXWTnKyLeD99oAYY=; b=p4JOyCTfvostWkTGs2xIt5mL4R0wxWzooHZY86KwdwoA2HTKQzDcLxn4FjrLXfePOwcm3h 0FsUVFkkSbb90cOW8T80flRWnxHimgQLpeBHbU2n4ne5aI6J01a8P3KG7Rsg/zG+mvjnAt Lf37MExpvxmVwAXqWXVFi22n/Zvet84= Received: from remote.index.de (business-90-187-114-221.pool2.vodafone-ip.de [90.187.114.221]) by mxbox1.masterlogin.de (Postfix) with ESMTPSA id 722F94046E; Fri, 4 Jun 2021 00:10:26 +0000 (UTC) Received: from invidia.index-gruppe.local (192.168.3.140) by acedia.index-gruppe.local (192.168.3.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Fri, 4 Jun 2021 02:10:25 +0200 Received: from invidia.index-gruppe.local (192.168.3.140) by invidia.index-gruppe.local (192.168.3.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Fri, 4 Jun 2021 02:10:25 +0200 Received: from invidia.index-gruppe.local ([fe80::50c:3e08:f8e2:5a62]) by invidia.index-gruppe.local ([fe80::50c:3e08:f8e2:5a62%16]) with mapi id 15.01.2176.014; Fri, 4 Jun 2021 02:10:25 +0200 From: Arne Roland To: Tomas Vondra , Zhihong Yu CC: pgsql-hackers Subject: Re: PATCH: generate fractional cheapest paths in generate_orderedappend_path Thread-Topic: PATCH: generate fractional cheapest paths in generate_orderedappend_path Thread-Index: AQHXMxwFBSWPrfL6EUqWBkKfzekca6rGmsgBgDwx81n///NcAIAALGoAgAAAZwCAAAGEAIAASqAY Date: Fri, 4 Jun 2021 00:10:25 +0000 Message-ID: <920f0b3b5761410ab6833787211af250@index.de> References: , In-Reply-To: Accept-Language: en-US, de-DE Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.255.1.33] Content-Type: multipart/alternative; boundary="_000_920f0b3b5761410ab6833787211af250indexde_" MIME-Version: 1.0 X-Mail-ID: f080f488-39ad-438e-a905-39abbe893cae List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --_000_920f0b3b5761410ab6833787211af250indexde_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, thanks for the quick reply! From: Tomas Vondra Sent: Thursday, June 3, 2021 20:11 To: Arne Roland; pgsql-hackers Subject: Re: PATCH: generate fractional cheapest paths in generate_ordereda= ppend_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 bett= er. 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_ordereda= ppend_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_pathk= eys 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 an= yway. I think that is the reason it doesn't do that already. ________________________________ From: Zhihong Yu Sent: Thursday, June 3, 2021 22:50 To: Tomas Vondra Cc: Arne Roland; pgsql-hackers Subject: Re: PATCH: generate fractional cheapest paths in generate_ordereda= ppend_path Hi, In REL_11_STABLE branch, a search revealed the following: src/backend/optimizer/path/pathkeys.c: * get_cheapest_fractional_path_for_p= athkeys src/backend/optimizer/path/pathkeys.c:get_cheapest_fractional_path_for_path= keys(List *paths, src/backend/optimizer/plan/planagg.c: get_cheapest_fractional_pat= h_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 ambitiou= s 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 Sent: Thursday, June 3, 2021 22:57 To: Zhihong Yu Cc: Arne Roland; pgsql-hackers Subject: Re: PATCH: generate fractional cheapest paths in generate_ordereda= ppend_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 =3D=3D 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 t= hat 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 --_000_920f0b3b5761410ab6833787211af250indexde_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

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_o= rderedappend_path

> I haven't tested t= he 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 r= eply
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_o= rderedappend_path

>3) Not sure if get_cheapest_fractional_path_for_pathkeys should worr= y

> about require_parallel_safe, just like the other functions nearby= .

I think it should. We have a ParallelAppend node after al= l.
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 minm= ax paths are never parallel safe anyway. I think that is the reason it does= n'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_o= rderedappend_path
 

Hi,
In REL_11_STABLE branch, a search revealed the following:

src/backend/optimizer/path/pathkeys.c: * get_cheapest_fractional_path_for_p= athkeys
src/backend/optimizer/path/pathkeys.c:get_cheapest_fractional_path_for_path= keys(List *paths,
src/backend/optimizer/plan/planagg.c:           ge= t_cheapest_fractional_path_for_pathkeys(final_rel->pathlist,
src/include/optimizer/paths.h:extern Path *get_cheapest_fractional_pat= h_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 exi= sted.


From: Tomas Vondra <tomas.vondra@ente= rprisedb.com>
Sent: Thursday, June 3, 2021 22:57
To: Zhihong Yu
Cc: Arne Roland; pgsql-hackers
Subject: Re: PATCH: generate fractional cheapest paths in generat= e_orderedappend_path
Actually, there are two comments
       = /* XXX maybe we should have startup_new_fractional? */

in the patch I posted - I completely forgo= t 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 s= tartup_neq_total, i.e. it's
pointless to add paths where startup =3D= =3D 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?<= /span>

Regards
Arne

--_000_920f0b3b5761410ab6833787211af250indexde_--