Re: [PATCH] Caching for stable expressions with constant arguments v3

Поиск
Список
Период
Сортировка
От Marti Raudsepp
Тема Re: [PATCH] Caching for stable expressions with constant arguments v3
Дата
Msg-id CABRT9RB7rdvke7JHg853fnJO42DyxagS0EuX1fojMfY7=tAxVA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATCH] Caching for stable expressions with constant arguments v3  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Ответы Re: [PATCH] Caching for stable expressions with constant arguments v3  (Marti Raudsepp <marti@juffo.org>)
Список pgsql-hackers
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

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: ecmascript 5 DATESTYLE
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Inlining comparators as a performance optimisation