Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 61D261337B68 for ; Wed, 20 Apr 2011 23:13:26 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 57741-03 for ; Thu, 21 Apr 2011 02:13:09 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp-1.01.com (smtp-1.01.com [38.102.63.180]) by mail.postgresql.org (Postfix) with ESMTP id 91DAA1337B47 for ; Wed, 20 Apr 2011 23:13:08 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp-1.01.com (Postfix) with ESMTP id 292AF36557C; Wed, 20 Apr 2011 21:13:09 -0500 (CDT) Received: from smtp-1.01.com ([127.0.0.1]) by localhost (smtp-1.01.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Wa2BKsEcuqko; Wed, 20 Apr 2011 21:13:09 -0500 (CDT) Received: by smtp-1.01.com (Postfix, from userid 99) id 07CC036461A; Wed, 20 Apr 2011 21:13:09 -0500 (CDT) Received: from Sidney-Stratton.local (70-36-143-243.dsl.dynamic.sonic.net [70.36.143.243]) by smtp-1.01.com (Postfix) with ESMTPSA id A2C0436557C; Wed, 20 Apr 2011 21:13:08 -0500 (CDT) Message-ID: <4DAF92B3.60806@agliodbs.com> Date: Wed, 20 Apr 2011 19:13:07 -0700 From: Josh Berkus Organization: PostgreSQL Experts Inc. User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 MIME-Version: 1.0 To: Brendan Jurd CC: Tom Lane , pgsql-performance@postgresql.org Subject: Re: Constraint exclusion can't process simple constant expressions? References: <4DAF70FD.7000609@agliodbs.com> <26139.1303346929@sss.pgh.pa.us> <4DAF8F60.9050407@agliodbs.com> In-Reply-To: X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201104/287 X-Sequence-Number: 43349 > Emphasis on "always". If the result of the function, given the same > argument values, can be different after a SET, then it doesn't qualify > for immutability. At least, that's my understanding. Hmmmm. But within the context of the query plan itself, the results of that expression are going to be constant. That is, for a given query execution, it's always going to be the same comparison. So this goes back to my original assertion that CE can't be fixed ... -- Josh Berkus PostgreSQL Experts Inc. http://pgexperts.com