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 1fQx4T-0001cP-2D for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Jun 2018 15:43:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fQx4P-0006kf-7k for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Jun 2018 15:43:25 +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 1fQx4P-0006kW-0q for pgsql-hackers@lists.postgresql.org; Thu, 07 Jun 2018 15:43:25 +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 1fQx4M-0002vq-Bn for pgsql-hackers@lists.postgresql.org; Thu, 07 Jun 2018 15:43:24 +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 w57FhCvU022806; Thu, 7 Jun 2018 11:43:12 -0400 From: Tom Lane To: David Rowley cc: Amit Langote , Dmitry Dolgov <9erthalion6@gmail.com>, Jeff Janes , Ashutosh Bapat , Pavel Stehule , PostgreSQL Hackers Subject: Re: why partition pruning doesn't work? In-reply-to: References: <7142.1527868419@sss.pgh.pa.us> <1111.1527977170@sss.pgh.pa.us> <10432.1528045900@sss.pgh.pa.us> <569483c5-a273-6537-1b5d-7a271ce439fb@lab.ntt.co.jp> Comments: In-reply-to David Rowley message dated "Wed, 06 Jun 2018 21:52:04 +1200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <22804.1528386192.1@sss.pgh.pa.us> Date: Thu, 07 Jun 2018 11:43:12 -0400 Message-ID: <22805.1528386192@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk David Rowley writes: > On 6 June 2018 at 18:05, Amit Langote wrote: >> I wonder why we need to create those Bitmapsets in the planner? Why not >> in ExecSetupPartitionPruneState()? For example, like how >> context->exprstates is initialized. > That seems like a good idea. Certainly much better than working them > out each time we prune. > v3 patch attached. Maybe there's something I'm missing here, but I sort of hoped that this patch would nuke all the special-case code for Params in this area. Why is there any need to distinguish them from other stable expressions? IOW, I was hoping for the code to end up simpler, not more complicated. regards, tom lane