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 1lxAaH-0007Nn-6i for pgsql-hackers@arkaria.postgresql.org; Sat, 26 Jun 2021 15:51:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lxAaG-0003Xb-4q for pgsql-hackers@arkaria.postgresql.org; Sat, 26 Jun 2021 15:51:04 +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 1lxAaF-0003XT-In for pgsql-hackers@lists.postgresql.org; Sat, 26 Jun 2021 15:51:03 +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 1lxAaB-0007T0-I2 for pgsql-hackers@postgresql.org; Sat, 26 Jun 2021 15:51:02 +0000 Received: from mxbox2.masterlogin.de (unknown [192.168.10.89]) by mxout3.routing.net (Postfix) with ESMTP id 7C4A060332; Sat, 26 Jun 2021 15:50:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1624722651; 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=hYE5bNv5DQdcyEWnlLbtYzXH0IR2ucPodbv9sgrknrU=; b=XmPGqZvZMdsOAuOexNJYPaFORFbTFu3GrF/yh3ABt6aggfWgJyZHC5r3XXYxcu0t6I8qbL D7R3o7tc8CKvNU76naWjpXlqdoQNd+IDrTbN+IKscrpqiW5rvKKdYuSieVXN5t2UDBzFCe 9F663qENPsCpHtdEGLN4p/fnRo5vE2s= Received: from remote.index.de (business-90-187-114-221.pool2.vodafone-ip.de [90.187.114.221]) by mxbox2.masterlogin.de (Postfix) with ESMTPSA id 1EBBB100671; Sat, 26 Jun 2021 15:50:51 +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; Sat, 26 Jun 2021 17:50:50 +0200 Received: from acedia.index-gruppe.local (192.168.3.121) 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; Sat, 26 Jun 2021 17:50:50 +0200 Received: from acedia.index-gruppe.local ([fe80::85fe:a34b:726c:9304]) by acedia.index-gruppe.local ([fe80::85fe:a34b:726c:9304%13]) with mapi id 15.01.2176.014; Sat, 26 Jun 2021 17:50:49 +0200 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///NcAIAALGoAgAAAZwCAAAGEAIAASqAYgCOeUZs= Date: Sat, 26 Jun 2021 15:50:49 +0000 Message-ID: <6be31b4511c8424db3deeff5c5b8855e@index.de> References: ,,<920f0b3b5761410ab6833787211af250@index.de> In-Reply-To: <920f0b3b5761410ab6833787211af250@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_6be31b4511c8424db3deeff5c5b8855eindexde_" MIME-Version: 1.0 X-Mail-ID: 6965de98-b86b-4f29-ab5e-088d60978386 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --_000_6be31b4511c8424db3deeff5c5b8855eindexde_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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_6be31b4511c8424db3deeff5c5b8855eindexde_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

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_6be31b4511c8424db3deeff5c5b8855eindexde_--