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 1fnLk6-0004Gz-R6 for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Aug 2018 10:31:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fnLk4-0001EU-PT for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Aug 2018 10:31:00 +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 1fnLk4-0001EN-Ig for pgsql-hackers@lists.postgresql.org; Wed, 08 Aug 2018 10:31:00 +0000 Received: from feynman.df7cb.de ([195.49.152.168]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fnLk1-0004c0-63 for pgsql-hackers@postgresql.org; Wed, 08 Aug 2018 10:30:59 +0000 Received: from msg.df7cb.de (unknown [IPv6:2003:5b:203b:100:7627:eaff:fe52:8e03]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by feynman.df7cb.de (Postfix) with ESMTPSA id 41lnjC4nL4z3DxP for ; Wed, 8 Aug 2018 12:30:55 +0200 (CEST) Date: Wed, 8 Aug 2018 12:30:55 +0200 From: Christoph Berg To: PostgreSQL Hackers Subject: Re: pgsql: Fix run-time partition pruning for appends with multiple source Message-ID: <20180808103055.GC3999@msg.df7cb.de> Mail-Followup-To: Christoph Berg , PostgreSQL Hackers References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Re: Tom Lane 2018-08-02 > Fix run-time partition pruning for appends with multiple source rels. > > The previous coding here supposed that if run-time partitioning applied to > a particular Append/MergeAppend plan, then all child plans of that node > must be members of a single partitioning hierarchy. This is totally wrong, > since an Append could be formed from a UNION ALL: we could have multiple > hierarchies sharing the same Append, or child plans that aren't part of any > hierarchy. > > To fix, restructure the related plan-time and execution-time data > structures so that we can have a separate list or array for each > partitioning hierarchy. Also track subplans that are not part of any > hierarchy, and make sure they don't get pruned. > > Per reports from Phil Florent and others. Back-patch to v11, since > the bug originated there. Since this commit added a new node type, all following node types got renumbered. This means all extension modules using the information compiled against 11beta2 need to be recompiled against 11beta3. For apt.postgresql.org, the list of affected modules (so far, haven't yet checked all) is pgsql-ogr-fdw, plr, wal2json. I believe this should be mentioned in the beta3 release notes. Christoph (Thanks to Andrew Gierth for helping me pinpoint the issue.)