Re: [HACKERS] WIP Patch: Precalculate stable functions,infrastructure v1 - Mailing list pgsql-hackers

From Marina Polyakova
Subject Re: [HACKERS] WIP Patch: Precalculate stable functions,infrastructure v1
Date
Msg-id d47337f599ef0b2c9cd1578ef70d5aee@postgrespro.ru
Whole thread Raw
In response to Re: [HACKERS] WIP Patch: Precalculate stable functions,infrastructure v1  (Marina Polyakova <m.polyakova@postgrespro.ru>)
Responses Re: WIP Patch: Precalculate stable functions, infrastructure v1
List pgsql-hackers
Hello, hackers!

Here there's a seventh version of the patch for the precalculation of 
stable or immutable functions, stable or immutable operators and other 
nonvolatile expressions. It is rebased on the top of master and has some 
code cleanup [1]. See attached patch.

About TPC-H tests using dbt3 (see the attached small archieve):
* they were made based on commit 
255f14183ac7bc6a83a5bb00d67d5ac7e8b645f1;
* they take some time so I have used only scales 1 and 4;
* 3 attempts are used to eliminate some noise; so you can see the 
minimum, median and maximum execution time for each query on the graphs.
About their results:
* as expected, cached expressions were not used in queries;
* it seems that there is no obvious degradation of performance.

Any suggestions are welcome!

[1] Fixed:

>> Also I see this pattern quite some time, maybe it makes sense to move
>> it to a function?
>> 
>> ```
>> + /* create and return CachedExpr */
>> + CachedExpr *new_node = makeNode(CachedExpr);
>> + new_node->subexpr = (CacheableExpr *) current_node;
>> +
>> + context->root->hasCachedExpr = true;
>> +
>> + return (Node *) new_node;
>> ```
> 
> Thanks, I agree with you and I'll change it accordingly.

-- 
Marina Polyakova
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
Attachment

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: WIP: a way forward on bootstrap data
Next
From: Fabien COELHO
Date:
Subject: Re: Implementing SQL ASSERTION