pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Restrict Datum sort optimization to byval types only 2+ messages / 1 participants [nested] [flat]
* pgsql: Restrict Datum sort optimization to byval types only @ 2022-09-28 22:43 David Rowley <drowley@postgresql.org> 0 siblings, 0 replies; 2+ messages in thread From: David Rowley @ 2022-09-28 22:43 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 ------ master Details ------- https://git.postgresql.org/pg/commitdiff/3a5817695a8360011864c1834f8a90ffdfc7f840 Modified Files -------------- src/backend/executor/nodeSort.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Restrict Datum sort optimization to byval types only @ 2022-09-28 22:44 David Rowley <drowley@postgresql.org> 0 siblings, 0 replies; 2+ messages in thread From: David Rowley @ 2022-09-28 22:44 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2022-09-28 22:44 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2022-09-28 22:43 pgsql: Restrict Datum sort optimization to byval types only David Rowley <drowley@postgresql.org> 2022-09-28 22:44 pgsql: Restrict Datum sort optimization to byval types only David Rowley <drowley@postgresql.org>
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