Re: Proposal : Use bump memory context for temp buffers

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Daniil Davydov <3danissimo(at)gmail(dot)com>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Proposal : Use bump memory context for temp buffers
Date: 2025-12-16 13:51:14
Message-ID: e3c9f95d-81a8-4cc1-8836-942e7ad86430@iki.fi
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 16/12/2025 15:05, Daniil Davydov wrote:
> Hi,
>
> Commit [1] introduced a new memory context suitable for situations when we
> should allocate a large amount of memory with no need to free or reallocate it.
>
> I think that it will be useful for temp buffers :
> 1) We allocate them lazily and never try to free them.
> 2) Some users are very active in working with temporary tables, and as
> a result,
> they set large values for the "temp_buffers" parameter (several gigabytes).
>
> Thus, the use case for temp buffers seems to perfectly fit for bump
> memory context.
> What do you think?

It makes no difference. The bump memory context is useful if you perform
a lot of small allocations, because it skips the overhead of the chunk
headers. In LocalBufferContext, we only ever make one allocation.

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nazir Bilal Yavuz 2025-12-16 13:58:03 Running GSSAPI / Kerberos tests on Windows
Previous Message Heikki Linnakangas 2025-12-16 13:43:53 Re: Revisiting {CREATE INDEX, REINDEX} CONCURRENTLY improvements