Re: [HACKERS] WIP Patch: Precalculate stable functions,infrastructure v1

Поиск
Список
Период
Сортировка
От Marina Polyakova
Тема Re: [HACKERS] WIP Patch: Precalculate stable functions,infrastructure v1
Дата
Msg-id 1c43da24e1179518288fe06563affc09@postgrespro.ru
обсуждение исходный текст
Ответ на Re: [HACKERS] WIP Patch: Precalculate stable functions,infrastructure v1  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: [HACKERS] WIP Patch: Precalculate stable functions,infrastructure v1  (Dmitry Dolgov <9erthalion6@gmail.com>)
Список pgsql-hackers
Hello, hackers!

First of all, happy New Year!

Secondly, here there's a sixth version of the patch for the 
precalculation of stable or immutable functions, stable or immutable 
operators and other nonvolatile expressions.

The basic idea: the expression is precalculated (= calculated once for 
all output rows, but as many times as the expression is mentioned in the 
query) if:
1) it doesn't return a set,
2) it's not volatile itself,
3) its arguments are also constants or precalculated expressions.

Differences from the previous version:
* rebased, including changes for ArrayCoerce expressions;
* support for prepared statements (including tests, but only for 
immutable functions);
* fix the caching of SQLValueFunctions (all of them are stable even 
date/time functions);
* added the expected output for the tests in case the xml functions are 
not supported;
* the tests are also performed in make check, not just in make 
check-world;
* code cleanup.

Like for the previous patches it seems that there is no obvious 
performance degradation too on regular queries (according to pgbench).

> pgbench probably isn't a very good test for this sort of thing - it
> only issues very short-running queries where the cost of evaluating
> expressions is a relatively small part of the total cost.  Even if
> things get worse, I'm not sure if you'd see it.  I'm not sure exactly
> how you could construct a test case that could be harmed by this patch
> - I guess you'd want to initialize lots of CacheExprs but never make
> use of the caching usefully?
> 
> It could also be useful to test things like TPC-H to see if you get an
> improvement.
I'm sorry, the TPC-H comparative tests will be later..

Patch is attached. Any suggestions are welcome!

-- 
Marina Polyakova
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Better testing coverage and unified coding for plpgsql loops
Следующее
От: Masahiko Sawada
Дата:
Сообщение: Re: [HACKERS] Commits don't block for synchronous replication