From: David Rowley <drowley@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Restrict Datum sort optimization to byval types only
Date: Wed, 28 Sep 2022 22:44:06 +0000
Message-ID: <E1odfmf-0003Hu-Mq@gemulon.postgresql.org> (raw)
Restrict Datum sort optimization to byval types only
91e9e89dc modified nodeSort.c so that it used datum sorts when the
targetlist of the outer node contained only a single column. That commit
failed to recognise that the Datum returned by tuplesort_getdatum() must
be pfree'd when the type is a byref type. Ronan Dunklau did originally
propose the patch with that restriction, but that, probably through my own
fault, got lost during further development work.
Due to the timing of this report (PG15 RC1 is almost out the door), let's
just restrict the datum sort optimization to apply for byval types only.
We might want to look harder into making this work for byref types in
PG16.
Reported-by: Önder Kalacı
Diagnosis-by: Tom Lane
Discussion: https://postgr.es/m/CACawEhVxe0ufR26UcqtU7GYGRuubq3p6ZWPGXL4cxy_uexpAAQ@mail.gmail.com
Backpatch-through: 15, where 91e9e89dc was introduced.
Branch
------
REL_15_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/f7ae8a2e186ca27f4ea64fddc21bfabaf0618507
Modified Files
--------------
src/backend/executor/nodeSort.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: drowley@postgresql.org
Subject: Re: pgsql: Restrict Datum sort optimization to byval types only
In-Reply-To: <E1odfmf-0003Hu-Mq@gemulon.postgresql.org>
References: <E1odfmf-0003Hu-Mq@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox