Re: [PATCH] Caching for stable expressions with constant arguments v3 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCH] Caching for stable expressions with constant arguments v3
Date
Msg-id 136.1323106270@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCH] Caching for stable expressions with constant arguments v3  (Marti Raudsepp <marti@juffo.org>)
Responses Re: [PATCH] Caching for stable expressions with constant arguments v3  (Marti Raudsepp <marti@juffo.org>)
List pgsql-hackers
Marti Raudsepp <marti@juffo.org> writes:
> On Sun, Dec 4, 2011 at 22:53, Heikki Linnakangas
> <heikki.linnakangas@enterprisedb.com> wrote:
>> This comment in RelationGetExpressions() also worries me:
> [...]
>> Do the injected CacheExprs screw up that equality? Or the constraint
>> exclusion logic in predtest.c?

> I suspect these cases are guaranteed not to produce any CacheExprs.
> They're always immutable expressions. If they contain Var references
> they're stored as is (not cachable); if not, they're folded to a
> constant.

> But I will have to double-check all the callers; it might be a good
> idea to disable caching anyway in these cases.

I think if you have some call sites inject CacheExprs and others not,
it will get more difficult to match up expressions that should be
considered equal.  On the whole this seems like a bad idea.  What is
the reason for having such a control boolean in the first place?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: exit() calls in libraries
Next
From: Tom Lane
Date:
Subject: Re: Inlining comparators as a performance optimisation