Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h3CD4-0002VF-V8 for pgsql-hackers@arkaria.postgresql.org; Mon, 11 Mar 2019 04:06:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h3CD3-0005oL-MX for pgsql-hackers@arkaria.postgresql.org; Mon, 11 Mar 2019 04:06:41 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h3CD3-0005bX-8v for pgsql-hackers@lists.postgresql.org; Mon, 11 Mar 2019 04:06:41 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h3CCw-0004Lq-Ir for pgsql-hackers@postgresql.org; Mon, 11 Mar 2019 04:06:39 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x2B46UVF032402; Mon, 11 Mar 2019 00:06:30 -0400 From: Tom Lane To: Etsuro Fujita cc: Robert Haas , Pg Hackers Subject: Re: Oddity with parallel safety test for scan/join target in grouping_planner In-reply-to: <5C85DC65.2050409@lab.ntt.co.jp> References: <5C75303E.8020303@lab.ntt.co.jp> <5C7908B9.5070407@lab.ntt.co.jp> <24818.1552077419@sss.pgh.pa.us> <5C85DC65.2050409@lab.ntt.co.jp> Comments: In-reply-to Etsuro Fujita message dated "Mon, 11 Mar 2019 12:56:21 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <32400.1552277190.1@sss.pgh.pa.us> Date: Mon, 11 Mar 2019 00:06:30 -0400 Message-ID: <32401.1552277190@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Etsuro Fujita writes: >>> The parallel safety of the final scan/join target is determined from the >>> grouping target, not that target, which [ is wrong ] > This would only affect plan quality a little bit, so I don't think we > need a regression test for this, either, but the fix might destabilize > existing plan choices, so we should apply it to HEAD only? Is that the only possible outcome? Per Robert's summary quoted above, it seems like it might be possible for the code to decide that the final scan/join target to be parallel safe when it is not, leading to outright wrong answers or query failures. If the wrong answer can only be wrong in the safe direction, it's not very clear why. regards, tom lane