Re: Reduce TupleHashEntryData struct size by half
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Jeff Davis <pgsql@j-davis.com>, Heikki Linnakangas <hlinnaka@iki.fi>, pgsql-hackers@postgresql.org
Date: 2025-01-14T18:11:21Z
Lists: pgsql-hackers
On 2025-Jan-14, David Rowley wrote: > The trick would be to ensure ExecClearTuple() still works. You > obviously don't want to try and pfree() something that isn't a pointer > to a palloc'd chunk. I'm not sure what the best API is, but I do see > there are other places that might benefit from something that allows > this. The two usages of ExecCopySlotMinimalTuple() in nodeMemoize.c > are candidates. Maybe it would work to set a new flag in TupleTableSlot->tts_flag so that ExecClearTuple() knows to handle it in some particular way (i.e., just skip the ->clear call altogether), with the idea that the tuple memory belongs elsewhere and must not be freed by ExecClearTuple? -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "Los dioses no protegen a los insensatos. Éstos reciben protección de otros insensatos mejor dotados" (Luis Wu, Mundo Anillo)
Commits
-
Comment fixups from 626df47ad9.
- a0c7b765372d 18.0 landed
-
Remove 'additional' pointer from TupleHashEntryData.
- 626df47ad9db 18.0 cited
-
Add ExecCopySlotMinimalTupleExtra().
- a0942f441ed6 18.0 landed
-
Create accessor functions for TupleHashEntry.
- 4d143509cbfa 18.0 landed
-
TupleHashTable: store additional data along with tuple.
- e0ece2a981ee 18.0 landed
-
ExecInitAgg: update aggstate->numaggs and ->numtrans earlier.
- 3f482940dbcb 18.0 landed
-
nodeSetOp.c: missing additionalsize for BuildTupleHashTable().
- 32ddfaffd149 18.0 landed
-
Remove unused TupleHashTableData->entrysize.
- 8a96faedc408 18.0 landed
-
Add missing typedefs.list entry for AggStatePerGroupData.
- 834c9e807cf1 18.0 landed