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 1fR7za-0002ns-Sy for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Jun 2018 03:23:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fR7zZ-0004rj-Gb for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Jun 2018 03:23:09 +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 1fR7zZ-0004rH-5n for pgsql-hackers@lists.postgresql.org; Fri, 08 Jun 2018 03:23:09 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fR7zS-0006Cb-CF for pgsql-hackers@lists.postgresql.org; Fri, 08 Jun 2018 03:23:07 +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 w583Mp1w021788; Thu, 7 Jun 2018 23:22:51 -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> <22805.1528386192@sss.pgh.pa.us> Comments: In-reply-to David Rowley message dated "Fri, 08 Jun 2018 10:33:03 +1200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <21786.1528428171.1@sss.pgh.pa.us> Date: Thu, 07 Jun 2018 23:22:51 -0400 Message-ID: <21787.1528428171@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk David Rowley writes: > On 8 June 2018 at 03:43, Tom Lane wrote: >> 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? > We need to know which Params exist in the Expr as if there are no > Params, or only external Params, then we can run-time prune during > startup of the executor. This does not refute my question. Why doesn't the same logic apply to any stable expression? That is, ISTM a Param is a special case of that. regards, tom lane