On Thu, 29 Sept 2022 at 18:12, David Rowley <dgrowleyml@gmail.com> wrote:
> In the attached patch, I've added a function named
> tuplesort_getdatum_nocopy() which is the same as tuplesort_getdatum()
> only without the datumCopy(). I opted for the new function rather than
> a new parameter in the existing function just to reduce branching and
> additional needless overhead.
Per what was said over on [1], I've adjusted the patch to just add a
'copy' parameter to tuplesort_getdatum() instead of adding the
tuplesort_getdatum_nocopy() function.
I also adjusted some code in heapam_index_validate_scan() to pass
copy=false to tuplesort_getdatum(). The datum in question here is a
TID type, so this really only saves a datumCopy() / pfree on 32-bit
systems. I wasn't too interested in speeding 32-bit systems up with
this, it was more a case of being able to remove the #ifndef
USE_FLOAT8_BYVAL / pfree code.
I think this is a fairly trivial patch, so if nobody objects, I plan
to push it in the next few days.
David
[1] https://www.postgresql.org/message-id/65629.1664460603%40sss.pgh.pa.us