Re: partitioning performance tests after recent patches - Mailing list pgsql-hackers

From Tom Lane
Subject Re: partitioning performance tests after recent patches
Date
Msg-id 15694.1555340425@sss.pgh.pa.us
Whole thread Raw
In response to Re: partitioning performance tests after recent patches  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
List pgsql-hackers
Amit Langote <Langote_Amit_f8@lab.ntt.co.jp> writes:
> On 2019/04/15 4:19, Floris Van Nee wrote:
>> 2) Is running non-inlined SQL functions with a generic plan even the best option all the time? Wouldn't it be better
toadopt a similar approach to what plpgsql does, where it tries to test if using a generic plan is beneficial? The
non-inlineableSQL functions suffer a big performance hit for a large number of partitions, because they cannot rely on
staticplanning-time pruning. 

> I'd never noticed this before.  It indeed seems to be the case that SQL
> functions and plpgsql functions are handled using completely different
> code paths, of which only for the latter it's possible to use static
> planning-time pruning.

Yeah.  Another big problem with the current implementation of SQL
functions is that there's no possibility of cross-query plan caching.
At some point I'd like to throw away functions.c and start over
with an implementation more similar to how plpgsql does it (in
particular, with persistent state and use of the plan cache).
It hasn't gotten to the top of the to-do queue though, mostly because
I think not many people use SQL-language functions except when they
want them to be inlined.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: hyrax vs. RelationBuildPartitionDesc
Next
From: Tom Lane
Date:
Subject: Re: Accidental setting of XLogReaderState.private_data ?