Re: Don't overwrite scan key in systable_beginscan() - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Don't overwrite scan key in systable_beginscan()
Date
Msg-id 861cec7c-562c-4d33-853f-a657fd377752@eisentraut.org
Whole thread Raw
In response to Re: Don't overwrite scan key in systable_beginscan()  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 09.08.24 06:55, Tom Lane wrote:
> Noah Misch <noah@leadboat.com> writes:
>> On Thu, Aug 08, 2024 at 08:46:35AM +0200, Peter Eisentraut wrote:
>>> I propose to fix that by making a copy of the scan keys passed by the caller
>>> and make the modifications there.
> 
>> No objection, but this would obsolete at least some of these comments (the
>> catcache.c ones if nothing else):
> 
> That ties into something I forgot to ask: aren't there any copy steps
> or other overhead that we could remove, given this new API constraint?
> That would help address Robert's concern.

I added two more patches to the series here.

First (or 0004), some additional cleanup for code that had to workaround 
systable_beginscan() overwriting the scan keys, along the lines 
suggested by Noah.

Second (or 0005), an alternative to palloc is to make the converted scan 
keys a normal local variable.  Then it's just a question of whether a 
smaller palloc is preferred over an over-allocated local variable.  I 
think I still prefer the palloc version, but it doesn't matter much 
either way I think.

Attachment

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Remove support for old realpath() API
Next
From: "cca5507"
Date:
Subject: Re: Historic snapshot doesn't track txns committed in BUILDING_SNAPSHOT state