Re: Performance issues with v18 SQL-language-function changes - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Performance issues with v18 SQL-language-function changes
Date
Msg-id 1600725.1746109146@sss.pgh.pa.us
Whole thread Raw
In response to Re: Performance issues with v18 SQL-language-function changes  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I wrote:
> Hmm.  What seems to be going on here is that once the aggfns_trans()
> result gets large enough that the SQL-function-result tuplestore
> decides to spill to disk, when we pull the result tuple back out
> of the tuplestore with tuplestore_gettupleslot we end up with the
> jf_resultSlot holding a should-free tuple pointer that points into
> the tuplestore's storage.  After tuplestore_clear that is a dangling
> pointer, and the next use of the jf_resultSlot fails while trying to
> free the tuple.

I still haven't figured out why this wasn't a problem in the old
version of functions.c.  However, I did realize that my pending
patch at [1] gets rid of the problem in another way, by removing
functions.c's use of tuplestore_gettupleslot altogether.  Now
I'm tempted to just push that, instead of applying a band-aid that
will leave v18 doing this differently from both earlier and later
branches.

            regards, tom lane

[1] https://www.postgresql.org/message-id/2443532.1744919968%40sss.pgh.pa.us



pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: Should shared_preload_libraries be loaded during binary upgrade?
Next
From: "David E. Wheeler"
Date:
Subject: Re: RFC: Additional Directory for Extensions