Re: Yet another fast GiST build - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Yet another fast GiST build
Date
Msg-id 234863.1610916631@sss.pgh.pa.us
Whole thread Raw
In response to Re: Yet another fast GiST build  (Heikki Linnakangas <hlinnaka@iki.fi>)
Responses Re: Yet another fast GiST build
List pgsql-hackers
Heikki Linnakangas <hlinnaka@iki.fi> writes:
> On 12/01/2021 18:19, Andrey Borodin wrote:
>> Thanks! Looks good to me.

> Pushed, thanks!

I noticed that gist_page_items() thinks it can hold inter_call_data->rel
open across a series of calls.  That's completely unsafe: the executor
might not run the call series to completion (see LIMIT), resulting in
relcache leak complaints.  I suspect that it might have cache-flush
hazards even without that.  I think this code needs to be rewritten to do
all the interesting work in the first call.  Or maybe better, return the
results as a tuplestore so you don't have to do multiple calls at all.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: evtfoid and evtowner missing in findoidjoins/README
Next
From: Tomas Vondra
Date:
Subject: Re: COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits