Re: Add bump memory context type and use it for tuplesorts - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Add bump memory context type and use it for tuplesorts
Date
Msg-id 2488297.1711378392@sss.pgh.pa.us
Whole thread Raw
In response to Re: Add bump memory context type and use it for tuplesorts  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
Responses Re: Add bump memory context type and use it for tuplesorts
List pgsql-hackers
Tomas Vondra <tomas.vondra@enterprisedb.com> writes:
> IMHO the idea of having a general purpose memory context and then also
> specialized memory contexts for particular allocation patterns is great,
> and we should embrace it. Adding more and more special cases into
> AllocSet seems to go directly against that idea, makes the code more
> complex, and I don't quite see how is that better or easier to use than
> having a separate BumpContext ...

I agree with this completely.  However, the current design for chunk
headers is mighty restrictive about how many kinds of contexts we can
have.  We need to open that back up.

Could we move the knowledge of exactly which context type it is out
of the per-chunk header and keep it in the block header?  This'd
require that every context type have a standardized way of finding
the block header from a chunk.  We could repurpose the existing
MemoryContextMethodID bits to allow having a small number of different
ways, perhaps.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: Slow GRANT ROLE on PostgreSQL 16 with thousands of ROLEs
Next
From: Pankaj Raghav
Date:
Subject: Re: Large block sizes support in Linux