Re: WIP Patch: Precalculate stable functions, infrastructure v1

From: Marina Polyakova <m(dot)polyakova(at)postgrespro(dot)ru>
To: Aleksander Alekseev <a(dot)alekseev(at)postgrespro(dot)ru>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: WIP Patch: Precalculate stable functions, infrastructure v1
Date: 2017-07-18 13:16:19
Message-ID: 2767712a9f267e8f83bb5248e5a7c4ad@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello, hackers!

Here I have made the 5th version of the patches. I have added the
precalculation of all primitive nodes that don't return set, are not
volatile themselves and their arguments are constant or precalculated
expressions too. There're regression tests for all of them and little
notes in the documentation. Like for the previous patches it seems that
there is no obvious performance degradation too on regular queries
(according to pgbench).

About functionality: precalculation doesn't work for parameters nodes in
plan. So it doesn't work, for example, in the generic plans of prepared
statements. There'll be an another patch for them.

About code:
* Infrastructure patch changes: no enum and union for all 25
precalculated node types. Instead of them there is a new CacheableExpr
node which only contains a NodeTag.
* There're some changes for CoerceToDomain, which constraints now are
checked not only in the executor but in the planner too.

Patches are attached. Any suggestions are welcome!

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

Attachment Content-Type Size
v5-0001-Precalculate-stable-functions-infrastructure.patch text/x-diff 60.2 KB
v5-0002-Precalculate-stable-functions-planning-and-execut.patch text/x-diff 194.1 KB
v5-0003-Precalculate-stable-functions-costs.patch text/x-diff 7.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-07-18 13:42:31 Re: [PATCH] Make sure all statistics is sent after a few DML are performed
Previous Message Andres Freund 2017-07-18 13:06:44 Re: [PATCH] Make sure all statistics is sent after a few DML are performed