Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f5dVI-00086Y-Hx for pgsql-committers@arkaria.postgresql.org; Mon, 09 Apr 2018 20:35:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f5dVH-0004BC-22 for pgsql-committers@arkaria.postgresql.org; Mon, 09 Apr 2018 20:35:03 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f5dVG-0004A9-Pc for pgsql-committers@lists.postgresql.org; Mon, 09 Apr 2018 20:35:02 +0000 Received: from new1-smtp.messagingengine.com ([66.111.4.221]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f5dVD-0001kB-PN for pgsql-committers@lists.postgresql.org; Mon, 09 Apr 2018 20:35:01 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id B41AE1117; Mon, 9 Apr 2018 16:34:58 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 09 Apr 2018 16:34:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=dWA+QExkfIFoGZgMp p8hMdZoS6RGgr56txPfV5S/Io8=; b=cY7BqyQ7bRik85p5ZeA4gx+NxuykuIkkc /u3mQtd6ueo+1qIEYXO/8o2+AxNIa9zpCkG+zcT/nZweWn7cIxT5Zurswm3+zsD1 9vI25P/kxGQ9qg8uaWWyOwspn5QCPRYUs5aubFD6eS2jXDATIic2MAR5IE/KG9rj fk6rPOJZSUoV/Yly4fjIwFGQqWeTTknePepHQcUkTvcBajMuOOAZwSSopywjU5zI x/wuPMHJAEFidK1EdUsomvrYbcE+aToyL7ziBydfXil7EpkmA8KoYjY55NU6JPzh ZJ3PpQR+5aeEPtgHcMHCb6Rb9bxE4X4rEAijUkxH1SacQIPm6Lx7A== X-ME-Sender: Received: from alvin.alvh.no-ip.org (unknown [179.56.29.253]) by mail.messagingengine.com (Postfix) with ESMTPA id 2BD6F10256; Mon, 9 Apr 2018 16:34:58 -0400 (EDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 5623C366; Mon, 9 Apr 2018 17:34:56 -0300 (-03) Date: Mon, 9 Apr 2018 17:34:56 -0300 From: Alvaro Herrera To: David Rowley Cc: Tom Lane , Andrew Gierth , pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Support partition pruning at execution time Message-ID: <20180409203456.3c6mfmbd6sghgmbl@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170306-137-4415bd-dirty (1.8.0) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk David Rowley wrote: > Okay, I've written and attached a fix for this. I'm not 100% certain > that this is the cause of the problem on pademelon, but the code does > look wrong, so needs to be fixed. Hopefully, it'll make pademelon > happy, if not I'll think a bit harder about what might be causing that > instability. Pushed it just now. Let's see what happens with pademelon now. > The misleading comment claimed we unset the extern params so we didn't > perform pruning again using these. I'd failed to update this comment > after I realised that we still need to attempt to prune again with the > external params since quals against the partition key may actually > contain a mix of exec and external params, which would mean that it's > only possible to prune partitions using both types of params. No > actual code needs to be updated since the 2nd pass of pruning uses > "allparams" anyway. We could actually get away without the bms_free() > and set to NULL in the lines below the comment, but I wanted some way > to ensure that we never write any code which calls the function twice > on the same PartitionPruneState, but maybe I'm just overly paranoid > there. Pushed this earlier today, thanks. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services