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 1h3DBF-0005Fr-OF for pgsql-hackers@arkaria.postgresql.org; Mon, 11 Mar 2019 05:08:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h3DBC-0006cY-UI for pgsql-hackers@arkaria.postgresql.org; Mon, 11 Mar 2019 05:08:50 +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 1h3DBC-0006cQ-J9 for pgsql-hackers@lists.postgresql.org; Mon, 11 Mar 2019 05:08:50 +0000 Received: from tama50.ecl.ntt.co.jp ([129.60.39.147]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h3DB3-0005ic-SU for pgsql-hackers@postgresql.org; Mon, 11 Mar 2019 05:08:48 +0000 Received: from vc1.ecl.ntt.co.jp (vc1.ecl.ntt.co.jp [129.60.86.153]) by tama50.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id x2B58d9w026341; Mon, 11 Mar 2019 14:08:39 +0900 Received: from vc1.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 97F16EA89B6; Mon, 11 Mar 2019 14:08:39 +0900 (JST) Received: from jcms-pop21.ecl.ntt.co.jp (jcms-pop21.ecl.ntt.co.jp [129.60.87.134]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 8D5D1EA89AA; Mon, 11 Mar 2019 14:08:39 +0900 (JST) Received: from [IPv6:::1] (unknown [129.60.241.75]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTPSA id 7B7624002A9; Mon, 11 Mar 2019 14:08:39 +0900 (JST) Message-ID: <5C85ED63.8000805@lab.ntt.co.jp> Date: Mon, 11 Mar 2019 14:08:51 +0900 From: Etsuro Fujita User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 MIME-Version: 1.0 Subject: Re: Oddity with parallel safety test for scan/join target in grouping_planner 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> <32401.1552277190@sss.pgh.pa.us> In-Reply-To: <32401.1552277190@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-CC-Mail-RelayStamp: 1 To: Tom Lane Cc: Robert Haas , Pg Hackers X-TM-AS-MML: disable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk (2019/03/11 13:06), Tom Lane wrote: > 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. Maybe I'm missing something, but I think that if the final scan/join target is not parallel-safe, then the grouping target would not be parallel-safe either, by the construction of the two targets, so I don't think that we have such a correctness issue. Best regards, Etsuro Fujita