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 1h3DGh-0005UU-Tw for pgsql-hackers@arkaria.postgresql.org; Mon, 11 Mar 2019 05:14:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h3DGg-0006Hg-IV for pgsql-hackers@arkaria.postgresql.org; Mon, 11 Mar 2019 05:14:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h3DGg-0006HZ-BO for pgsql-hackers@lists.postgresql.org; Mon, 11 Mar 2019 05:14:30 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h3DGd-0001nj-Ok for pgsql-hackers@postgresql.org; Mon, 11 Mar 2019 05:14:29 +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 x2B5ELvG001963; Mon, 11 Mar 2019 01:14:21 -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: <5C85ED63.8000805@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> <32401.1552277190@sss.pgh.pa.us> <5C85ED63.8000805@lab.ntt.co.jp> Comments: In-reply-to Etsuro Fujita message dated "Mon, 11 Mar 2019 14:08:51 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1961.1552281261.1@sss.pgh.pa.us> Date: Mon, 11 Mar 2019 01:14:21 -0400 Message-ID: <1962.1552281261@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Etsuro Fujita writes: > (2019/03/11 13:06), Tom Lane wrote: >> 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. Seems to me it's the other way around: the final target would include all functions invoked in the grouping target plus maybe some more. So a non-parallel-safe grouping target implies a non-parallel-safe final target, but not vice versa. Possibly the summary had it backwards and the actual code bug is inferring things in the safe direction, but I'm too tired to double check that right now ... regards, tom lane