pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Rowley <drowley@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Use bump memory context for tuplesorts
Date: Sun, 07 Apr 2024 12:32:48 +0000
Message-ID: <E1rtRhX-000yHn-PW@gemulon.postgresql.org> (raw)

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6ed83d5fa55cf6e6c9d1be34ec10730c48eba763

Modified Files
--------------
src/backend/utils/sort/tuplesort.c         | 52 +++++++++++++++++-------------
src/backend/utils/sort/tuplesortvariants.c | 38 +++++++++++++++++++---
src/include/utils/tuplesort.h              | 21 +++++++++---
3 files changed, 78 insertions(+), 33 deletions(-)



view thread (4+ messages)  latest in thread

Message-ID: <E1rtRhX-000yHn-PW@gemulon.postgresql.org>
Permalink:  ../E1rtRhX-000yHn-PW@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rtRhX-000yHn-PW@gemulon.postgresql.org

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: drowley@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Use bump memory context for tuplesorts
  In-Reply-To: <E1rtRhX-000yHn-PW@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