Re: Why overhead of SPI is so large? - Mailing list pgsql-hackers

From Konstantin Knizhnik
Subject Re: Why overhead of SPI is so large?
Date
Msg-id ae38c01f-13cb-0e0a-bd35-c5ce92406425@postgrespro.ru
Whole thread Raw
In response to Re: Why overhead of SPI is so large?  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: Why overhead of SPI is so large?
List pgsql-hackers


On 23.08.2019 14:42, Pavel Stehule wrote:

In reality it is not IMMUTABLE function. On second hand, there are lot of application that depends on this behave.

It is well know trick how to reduce estimation errors related to JOINs. When immutable function has constant parameters, then it is evaluated in planning time.

So sometimes was necessary to use

SELECT ... FROM tab WHERE foreign_key = immutable_function('constant parameter')

instead JOIN.

It is ugly, but it is working perfectly. I think so until we will have multi table statistics, this behave should be available in Postgres.

Sure, this function should not be used for functional indexes.
 

What about the following version of the patch?



-- 
Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company 
Attachment

pgsql-hackers by date:

Previous
From: Roberto Mireles
Date:
Subject: Hstore OID bigger than an integer
Next
From: Stephen Frost
Date:
Subject: Re: [Proposal] Table-level Transparent Data Encryption (TDE) and KeyManagement Service (KMS)