Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fpLTb-0001MU-O8 for pgsql-bugs@arkaria.postgresql.org; Mon, 13 Aug 2018 22:38:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fpLTZ-00068f-21 for pgsql-bugs@arkaria.postgresql.org; Mon, 13 Aug 2018 22:38:13 +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_SHA384:256) (Exim 4.89) (envelope-from ) id 1fpLTY-00068Y-SD for pgsql-bugs@lists.postgresql.org; Mon, 13 Aug 2018 22:38:12 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fpLTW-00025x-9W for pgsql-bugs@lists.postgresql.org; Mon, 13 Aug 2018 22:38:12 +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 w7DMc4fA004003; Mon, 13 Aug 2018 18:38:04 -0400 From: Tom Lane To: "David G. Johnston" cc: Pavel Stehule , Marko Tiikkaja , Andres Freund , "andy@prestigedigital.com" , "pgsql-bugs@lists.postgresql.org" Subject: Re: BUG #15324: Non-deterministic behaviour from parallelised sub-query In-reply-to: References: <153417684333.10284.11356259990921828616@wrigleys.postgresql.org> <20180813163518.gqvu2kqwr6uj75vj@alap3.anarazel.de> <21038.1534181205@sss.pgh.pa.us> <22819.1534183487@sss.pgh.pa.us> Comments: In-reply-to "David G. Johnston" message dated "Mon, 13 Aug 2018 13:25:09 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4001.1534199884.1@sss.pgh.pa.us> Date: Mon, 13 Aug 2018 18:38:04 -0400 Message-ID: <4002.1534199884@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk "David G. Johnston" writes: > Could the planner stick a materialize node there that feeds the same set of > originally selected records to any parallel executors that end up pulling > from it? No. At least, Materialize as it stands doesn't help. There's no provision for pushing rowsets to parallel workers, only pulling from them, and it would be an extremely nontrivial thing to add AFAICS (for one thing, it'd make the leader process even more of a bottleneck than it is already). Maybe you could do something with dumping a rowset into a tuplestore and forcing that out to temp files on-disk before starting any of the parallel workers, then letting them read it in from the temp files. But that still looks like a lot of new work and completely not fit for back-patching, even if we had it. regards, tom lane