Re: Optimze usage of immutable functions as relation

From: Alexander Kuzmenkov <a(dot)kuzmenkov(at)postgrespro(dot)ru>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Aleksandr Parfenov <asp437(at)gmail(dot)com>
Cc: a(dot)bykov(at)postgrespro(dot)ru, pgsql-hackers(at)lists(dot)postgresql(dot)org, Antonin Houska <ah(at)cybertec(dot)at>, Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
Subject: Re: Optimze usage of immutable functions as relation
Date: 2019-03-20 16:58:21
Message-ID: 3f7fda2f-1cdc-8ad3-e3c9-c2436fb5d509@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/16/18 22:03, Tom Lane wrote:
> A possible fix for this is to do eval_const_expressions() on
> function RTE expressions at this stage (and then not need to
> do it later), and then pull up only when we find that the
> RTE expression has been reduced to a single Const.

Attached is a patch that does this, and transforms RTE_FUCTION that was
reduced to a single Const into an RTE_RESULT.

Not sure it does everything correctly, but some basic cases work. In
particular, I don't understand whether it needs any handling of "append
relations".

--
Alexander Kuzmenkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Attachment Content-Type Size
v5-0001-Simplify-immutable-RTE_FUNCTION-to-RTE_RESULT.patch text/x-patch 12.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Steele 2019-03-20 17:08:53 Re: Add exclusive backup deprecation notes to documentation
Previous Message Fabien COELHO 2019-03-20 16:46:32 Re: Offline enabling/disabling of data checksums