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 1msnXo-0004sB-Rn for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Dec 2021 14:58:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1msnXl-0005C2-Mc for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Dec 2021 14:58:41 +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 1msnXl-0005Bt-1u for pgsql-hackers@lists.postgresql.org; Thu, 02 Dec 2021 14:58:41 +0000 Received: from mxout3.routing.net ([2a03:2900:1:a::8]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1msnXg-0005Zf-U5 for pgsql-hackers@postgresql.org; Thu, 02 Dec 2021 14:58:39 +0000 Received: from mxbox1.masterlogin.de (unknown [192.168.10.88]) by mxout3.routing.net (Postfix) with ESMTP id ED9E160546; Thu, 2 Dec 2021 14:58:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1638457113; 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=7OpTltKbB1ZgC44drKwd7k/tffpxfLMnd0A+S7jHf7I=; b=uRufHdYVOOHh2Mxr7dgfxCX5FeIq48ANgCrHxAOme/x6S1MVJqQ7ygRu4wp6QzC+D/m91y Akh3QxtKpb8d7OxJAMR4kuKXllfIXRDUPxvU+AAucSnQCde4ftxl4vd1imZDYOg8yBvwHg k2kLx5nU302pFZ82OLJqFLYfSgzCH7M= Received: from remote.index.de (i68970D96.versanet.de [104.151.13.150]) by mxbox1.masterlogin.de (Postfix) with ESMTPSA id 676B0402ED; Thu, 2 Dec 2021 14:58:32 +0000 (UTC) Received: from acedia.index-gruppe.local (192.168.54.121) by invidia.index-gruppe.local (192.168.54.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Thu, 2 Dec 2021 15:58:29 +0100 Received: from acedia.index-gruppe.local ([fe80::a445:8e8f:dbeb:13de]) by acedia.index-gruppe.local ([fe80::a445:8e8f:dbeb:13de%13]) with mapi id 15.01.2308.020; Thu, 2 Dec 2021 15:58:29 +0100 From: Arne Roland To: Tomas Vondra 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///NcAIAALGoAgAAAZwCAAAGEAIAASqAYgCOeUZuA+duYRA== Date: Thu, 2 Dec 2021 14:58:28 +0000 Message-ID: References: ,,<920f0b3b5761410ab6833787211af250@index.de>,<6be31b4511c8424db3deeff5c5b8855e@index.de> In-Reply-To: <6be31b4511c8424db3deeff5c5b8855e@index.de> 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_bed8acdc24a74f6285b0d209a28b64f6indexde_" MIME-Version: 1.0 X-Mail-ID: 1b195f10-f49f-4176-8f82-fcd7efb2e318 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --_000_bed8acdc24a74f6285b0d209a28b64f6indexde_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Afaiac we should add a simple testcase here, like I suggested in 477344d5f1= 7c4a8e95d3a5bb6642718a. Apart from that I am not sure there is work= to be done here. Am I wrong? Regards Arne ________________________________ From: Arne Roland Sent: Saturday, June 26, 2021 5:50:49 PM To: Tomas Vondra Cc: pgsql-hackers Subject: Re: PATCH: generate fractional cheapest paths in generate_ordereda= ppend_path Hi Tomas, I don't think there is much work left to do here. Did you have a look at the test case? Did it make sense to you? And I am sorry. I had another look at this and it seems I was confused (aga= in). 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 > I think it should. We have a ParallelAppend node after all. > I'm not really familiar with the way get_cheapest_fractional_path_for_pat= hkeys 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. The whole segment were are talking about obviously assumes require_parallel= _safe is not needed. I wasn't aware that in set_append_rel_size. And I just= realized there is a great comment explaining why it rightfully does so: /* * If any live child is not parallel-safe, treat the whole appendre= l * as not parallel-safe. In future we might be able to generate pl= ans * in which some children are farmed out to workers while others ar= e * not; but we don't have that today, so it's a waste to consider * partial paths anywhere in the appendrel unless it's all safe. * (Child rels visited before this one will be unmarked in * set_append_rel_pathlist().) */ So afaik we don't need to think further about this. 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= that again with different queries/tables. > Just to be sure I get this correctly: You mean startup_gt_fractional (cos= t) as an additional condition, right? Could you clarify that for me? Regards Arne --_000_bed8acdc24a74f6285b0d209a28b64f6indexde_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

Afaiac we should add a simple testcase here, like I suggested in 477344d5f17c4a8e95d3a5bb6642718a. Apart from that I am not sure there i= s work to be done here.


Am I wrong?


Regards

Arne


From: Arne Roland <A.Rol= and@index.de>
Sent: Saturday, June 26, 2021 5:50:49 PM
To: Tomas Vondra
Cc: pgsql-hackers
Subject: Re: PATCH: generate fractional cheapest paths in generate_o= rderedappend_path
 

Hi Tomas,


I don't think there is much work left to do here.

Did you have a look at the test case? Did it make sense to you? 

And I am sorry. I had another look at this and it seems I was confused (aga= in).

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

> I think it should. We have a ParallelAppend node aft= er all.
> I'm not really familiar with the way get_cheapest_fractional_pat= h_for_pathkeys is used, but a quick search suggests to
=
> me, that build_m= inmax_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 a= lready.

The whole segment were ar= e talking about obviously assumes require_parallel_safe is not needed. I wasn't aware that in set_append_rel_size. And I just realized there is a great commen= t explaining why it rightfully does so:
         /*  
         * If any live child is not= parallel-safe, treat the whole appendrel
         * as not parallel-safe.&nb= sp; In future we might be able to generate plans
         * in which some children a= re farmed out to workers while others are
         * not; but we don't have t= hat today, so it's a waste to consider
         * partial paths anywhere i= n the appendrel unless it's all safe.
         * (Child rels visited befo= re this one will be unmarked in
         * set_append_rel_pathlist(= ).)
         */
So afaik we don't need to think further about this.


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_n= ew_fractional? */
>
> in the patch I posted - I completel= y forgot about that. But I think

> that's a typo, I think - it should = be

>
>=          /* XXX maybe we should have sta= rtup_neq_fractional? */
>
> and the new flag would work similar= ly to startup_neq_total, i.e. it's

> pointless to add paths where startu= p =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 mysel= f. I only got reminded upon seeing that again with different queries/tables= .
> Just to be sur= e I get this correctly: You mean startup_gt_fractional (cost) as an additional condition, right?

Could you clarify t= hat for me?

Regards
Arne

--_000_bed8acdc24a74f6285b0d209a28b64f6indexde_--