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

From Marti Raudsepp
Subject Re: [PATCH] Caching for stable expressions with constant arguments v3
Date
Msg-id CABRT9RDJiQKcbbYWzykVFiacDv9nBxzBJGSDLPMqVe5ohiSi2g@mail.gmail.com
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  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [PATCH] Caching for stable expressions with constant arguments v3  (Greg Smith <greg@2ndQuadrant.com>)
List pgsql-hackers
On Wed, Dec 7, 2011 at 00:29, Marti Raudsepp <marti@juffo.org> wrote:
> ExecInitExpr enables the cache when its 'PlanState *parent' attribute
> isn't NULL
[...]
> On the other hand, a few places lose caching support this way since
> they don't go through the planner:
> * Column defaults in a COPY FROM operation. Common use case is
> 'timestamp default now()'
> This might be a significant loss in some data-loading scenarios.
> * ALTER TABLE t ALTER col TYPE x USING some_expr(); No big loss here.

Let me rephrase that as a question: Does it seem worthwhile to add a
new argument to ExecInitExpr to handle those two cases? Does relying
on the PlanState argument being NULL seem like a bad idea for any
reason?

PS: I forgot to mention that 2 test cases covering the two above query
types are deliberately left failing in the v4-wip patch.

Regards,
Marti


pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: ecmascript 5 DATESTYLE
Next
From: Tom Lane
Date:
Subject: Re: [PATCH] Caching for stable expressions with constant arguments v3