Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YlhRQ-0001kE-Fe for pgsql-committers@arkaria.postgresql.org; Fri, 24 Apr 2015 17:31:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YlhRP-0002zD-C1 for pgsql-committers@arkaria.postgresql.org; Fri, 24 Apr 2015 17:31:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YlhRO-0002yw-FN for pgsql-committers@postgresql.org; Fri, 24 Apr 2015 17:31:02 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YlhRH-0001RU-1Q for pgsql-committers@postgresql.org; Fri, 24 Apr 2015 17:31:01 +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 t3OHUnQr029123; Fri, 24 Apr 2015 13:30:49 -0400 From: Tom Lane To: Qingqing Zhou cc: pgsql-committers@postgresql.org Subject: Re: pgsql: Fix incorrect matching of subexpressions in outer-join plan node In-reply-to: References: <22812.1428362539@sss.pgh.pa.us> Comments: In-reply-to Qingqing Zhou message dated "Mon, 06 Apr 2015 17:11:46 -0700" Date: Fri, 24 Apr 2015 13:30:49 -0400 Message-ID: <29122.1429896649@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org [ catching up on email post-vacation ] Qingqing Zhou writes: > On Mon, Apr 6, 2015 at 4:22 PM, Tom Lane wrote: >> Because it's expensive (a syscache lookup per function or operator). >> And that test alone would be insufficient anyway: you'd also have to >> check that there was an appropriate Var in the expression, cf the >> comment for contain_nonstrict_functions. > Looks like not only contain_nonstrict_functions() is expensive, but > other contain_xxx family members. > In FuncExpr structure, for example, we already cached values like > retset, resulttype, but why not volatile and isstrict? In this way, we > avoid cache lookup every time. So as OpExpr etc. The reason we don't store those in the expression tree is that changing those properties (eg with CREATE OR REPLACE FUNCTION) would break stored views referencing the function. It's okay to store resulttype and retset because we disallow changing the output type (including set-ness) of a function; but we don't want to disallow changing strictness for instance. regards, tom lane -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers