Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d9E9g-0007fs-QS for pgsql-docs@arkaria.postgresql.org; Fri, 12 May 2017 17:15:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d9E9g-00043R-DB for pgsql-docs@arkaria.postgresql.org; Fri, 12 May 2017 17:15:04 +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.84_2) (envelope-from ) id 1d9E9f-00042c-Jm for pgsql-docs@postgresql.org; Fri, 12 May 2017 17:15:03 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1d9E9d-0008Gq-2b for pgsql-docs@postgresql.org; Fri, 12 May 2017 17:15:02 +0000 Received: from bruce by momjian.us with local (Exim 4.84_2) (envelope-from ) id 1d9E9c-00076b-8k; Fri, 12 May 2017 13:15:00 -0400 Date: Fri, 12 May 2017 13:15:00 -0400 From: Bruce Momjian To: john.christofolakos@gmail.com Cc: pgsql-docs@postgresql.org Subject: Re: clarify constraint exclusion vs prepared statements Message-ID: <20170512171500.GC6721@momjian.us> References: <20170427202303.24360.26831@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170427202303.24360.26831@wrigleys.postgresql.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-docs Precedence: bulk Sender: pgsql-docs-owner@postgresql.org On Thu, Apr 27, 2017 at 08:23:03PM +0000, john.christofolakos@gmail.com wrote: > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/9.2/static/ddl-partitioning.html > Description: > > Section 5.9.6 of the documentation discusses caveats re use of constraint > exclusion on partitioned tables. It seems the restriction that the query > constraints must be expressed in terms of constants has been lifted, and now > constraints may be expressed in terms of parameterised values. > > I'm wondering if the restriction would still apply, though, in the case that > the query is being prepared in advance, then the constraint value passed in > as a parameter at execution time. It seems to me that constraint exclusion > would not be applied in this case, but would like clarification on this > point. I think you are right that we don't support any constraint exclusion at execution time, but using EXPLAIN should show you what it is doing. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription + -- Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-docs