Re: pgsql: Fix incorrect matching of subexpressions in outer-join plan node - Mailing list pgsql-committers

From Tom Lane
Subject Re: pgsql: Fix incorrect matching of subexpressions in outer-join plan node
Date
Msg-id 22812.1428362539@sss.pgh.pa.us
Whole thread Raw
In response to Re: pgsql: Fix incorrect matching of subexpressions in outer-join plan node  (Qingqing Zhou <zhouqq.postgres@gmail.com>)
Responses Re: pgsql: Fix incorrect matching of subexpressions in outer-join plan node
List pgsql-committers
Qingqing Zhou <zhouqq.postgres@gmail.com> writes:
> On Sat, Apr 4, 2015 at 4:55 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> (This is somewhat overkill, in that a strict expression could still be
>> matched, but it doesn't seem worth the effort to check that.)

> Just curious, checking an expression strictness is convenient in
> build_tlist_index() like this:

>    TargetEntry *tle = (TargetEntry *) lfirst(l);

> +  if (contain_nonstrict_functions((Node *)tle))
> +            *hasnonstrict = true;
> +

> And this will almost avoid the overkill at once. Why not do this?

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.

            regards, tom lane


pgsql-committers by date:

Previous
From: Qingqing Zhou
Date:
Subject: Re: pgsql: Fix incorrect matching of subexpressions in outer-join plan node
Next
From: Qingqing Zhou
Date:
Subject: Re: pgsql: Fix incorrect matching of subexpressions in outer-join plan node