Re: [PATCH] Caching for stable expressions with constant arguments v3
Marti Raudsepp <marti@juffo.org>
From: Marti Raudsepp <marti@juffo.org>
To: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>,
pgsql-hackers <pgsql-hackers@postgresql.org>, Josh Berkus <josh@agliodbs.com>
Date: 2011-12-06T22:29:22Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
include_if_exists facility for config file.
- 6d09b2105fb5 9.2.0 cited
Attachments
- cacheexpr-v4-wip.patch (text/x-patch) patch v4
On Mon, Dec 5, 2011 at 21:04, Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> wrote: > Yet another idea would be to leave the CacheExprs there, but provide a way > to reset the caches. PL/pgSQL could then reset the caches between every > invocation. Or pass a flag to ExecInitExpr() to skip through the CacheExprs. Great idea, I've ripped out all the conditional CacheExpr generation logic from the planner and added a new boolean to CacheExprState instead. This makes me happy as I'm now rid of most kludgy bits and reduced the patch size somewhat. This also solves Tom's concern. ExecInitExpr enables the cache when its 'PlanState *parent' attribute isn't NULL. On the one hand this works out well since PlanState always has a predictable life cycle thus caching is always safe. 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. Regards, Marti