Re: A potential memory leak on Merge Join when Sort node is not below Materialize node

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael@paquier.xyz>
Cc: David Rowley <dgrowleyml@gmail.com>, Ronan Dunklau <ronan.dunklau@aiven.io>, Önder Kalacı <onderkalaci@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-09-28T23:35:07Z
Lists: pgsql-hackers
Michael Paquier <michael@paquier.xyz> writes:
> Wouldn't it be better to have 3a58176 reflect the non-optimization
> path in the EXPLAIN output of a new regression test if none of the
> existing tests are able to show any difference?

This decision is not visible in EXPLAIN in any case.

			regards, tom lane



Commits

  1. Allow nodeSort to perform Datum sorts for byref types

  2. Restrict Datum sort optimization to byval types only

  3. Make nodeSort.c use Datum sorts for single column sorts

  4. Fix actual and potential double-frees around tuplesort usage.

  5. Allow avoiding tuple copy within tuplesort_gettupleslot().