Use bump memory context for tuplesorts
David Rowley <drowley@postgresql.org>
Use bump memory context for tuplesorts 29f6a959c added a bump allocator type for efficient compact allocations. Here we make use of this for non-bounded tuplesorts to store tuples. This is very space efficient when storing narrow tuples due to bump.c not having chunk headers. This means we can fit more tuples in work_mem before spilling to disk, or perform an in-memory sort touching fewer cacheline. Author: David Rowley Reviewed-by: Nathan Bossart Reviewed-by: Matthias van de Meent Reviewed-by: Tomas Vondra Reviewed-by: John Naylor Discussion: https://postgr.es/m/CAApHDvqGSpCU95TmM=Bp=6xjL_nLys4zdZOpfNyWBk97Xrdj2w@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/sort/tuplesort.c | modified | +29 −23 |
| src/backend/utils/sort/tuplesortvariants.c | modified | +33 −5 |
| src/include/utils/tuplesort.h | modified | +16 −5 |
Discussion
- Add bump memory context type and use it for tuplesorts 58 messages · 2023-06-27 → 2024-04-16