Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmSdg-00040y-5I for pgsql-bugs@arkaria.postgresql.org; Mon, 28 Aug 2017 22:36:12 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dmSdf-0005Dj-JE for pgsql-bugs@arkaria.postgresql.org; Mon, 28 Aug 2017 22:36:11 +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.84_2) (envelope-from ) id 1dmScw-0002lh-Cm; Mon, 28 Aug 2017 22:35:26 +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.84_2) (envelope-from ) id 1dmSct-0007Zs-8Q; Mon, 28 Aug 2017 22:35:25 +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 v7SMZHSK000301; Mon, 28 Aug 2017 18:35:17 -0400 From: Tom Lane To: Robert Haas cc: Amit Kapila , Noah Misch , "Adam, Etienne (Nokia-TECH/Issy Les Moulineaux)" , PostgreSQL Bugs , "Duquesne, Pierre (Nokia-TECH/Issy Les Moulineaux)" , pgsql-hackers Subject: Re: [HACKERS] [postgresql 10 beta3] unrecognized node type: 90 In-reply-to: References: <11673.1502467154@sss.pgh.pa.us> <20170815025243.GA3986579@rfd.leadboat.com> <26053.1502804769@sss.pgh.pa.us> <2941.1502979564@sss.pgh.pa.us> <28782.1502992247@sss.pgh.pa.us> <29467.1502993219@sss.pgh.pa.us> <18650.1502995942@sss.pgh.pa.us> <1105.1503008416@sss.pgh.pa.us> <24667.1503865781@sss.pgh.pa.us> <3924.1503923486@sss.pgh.pa.us> <13540.1503931678@! sss.pgh.pa.us> <16978.1503946802@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Mon, 28 Aug 2017 18:03:42 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <32767.1503959717.1@sss.pgh.pa.us> Date: Mon, 28 Aug 2017 18:35:17 -0400 Message-ID: <300.1503959717@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Robert Haas writes: > On Mon, Aug 28, 2017 at 3:00 PM, Tom Lane wrote: >> Count the "that"s (you're failing to notice the next line). > OK, true. But "Academic literature" -> "The academic literature" is > just second-guessing, I think. No, it was more to avoid reflowing the paragraph (or leaving a weirdly short line). > There should never be a parallel_aware node that's not beneath a > Gather or Gather Merge; I don't know what the meaning of such a plan > would be, so I think we're safe against such a thing appearing in the > future. What I'm unclear about is what happens with nodes that aren't > directly in the chain between the Gather and the parallel-aware node. Nothing. The parallel-aware node(s) get marked as dependent on the rescan parameter, and then that marking bubbles up to their ancestor nodes (up to the Gather). Nodes that are not ancestral to any parallel-aware node are unchanged. > Now consider Parallel Hash > (not yet committed), where we might get this: > Something > -> Gather > -> Merge Join > -> Sort > -> Parallel Seq Scan on a > -> Hash Join > -> Index Scan on b > -> Parallel Hash > -> Parallel Seq Scan on c > Now what? We clearly still need to force a re-sort of a, but what > about the shared hash table built on c? If we've still got that hash > table and it was a single-batch join, there's probably no need to > rescan it even though both the Parallel Hash node and the Parallel Seq > Scan beneath it are parallel-aware. In this case all workers > collaborated to build a shared hash table covering all rows from c; if > we've still got that, it's still good. In fact, even the workers can > reuse that hash table even though, for them, it'll not really be a > re-scan at all. Well, I'd say that's something for the parallel hash patch to resolve. Yes, if the contents of the hash table are expected to be the same regardless of how many workers were involved, then we shouldn't need to rebuild it after a rescan of the Gather. That would mean not marking either Parallel Hash or its descendant Parallel Seq Scan as dependent on the Gather's rescan param. That's not terribly hard to mechanize within the structure of this patch: just ignore the param at/below the ParallelHash. Cowboy coding would be, perhaps, if (plan->parallel_aware) { if (gather_param < 0) elog(ERROR, "parallel-aware plan node is not below a Gather"); + if (IsA(plan, Hash)) + gather_param = -1; + else context.paramids = bms_add_member(context.paramids, gather_param); } but probably we should think of a more arm's-length way to do it. Maybe parallel_aware should have more than two values, depending on whether the result of the node is context-dependent or not. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs