Re: Have nodeSort.c use datum sorts single-value byref types

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Have nodeSort.c use datum sorts single-value byref types
Дата
Msg-id CAApHDvqQu+HRvb8-wJARJ_UeF3yv3jRXNXaz=EhvrAFhhksfbg@mail.gmail.com
обсуждение исходный текст
Ответ на Have nodeSort.c use datum sorts single-value byref types  (David Rowley <dgrowleyml@gmail.com>)
Ответы Re: Have nodeSort.c use datum sorts single-value byref types  (David Rowley <dgrowleyml@gmail.com>)
Список pgsql-hackers
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

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Pavel Luzanov
Дата:
Сообщение: Re: replacing role-level NOINHERIT with a grant-level option
Следующее
От: Richard Guo
Дата:
Сообщение: Re: Reducing duplicativeness of EquivalenceClass-derived clauses