Re: [PATCH] Better Performance for PostgreSQL with large INSERTs

Philipp Marek <philipp@marek.priv.at>

From: Philipp Marek <philipp@marek.priv.at>
To: Kirill Reshke <reshkekirill@gmail.com>
Cc: pgsql-hackers@postgresql.org
Date: 2025-09-15T13:40:24Z
Lists: pgsql-hackers
Hi Kirill,

> Changing this constant will result in an overwhelming increase of
> memory consumption for instances that work with a large number of
> connections (
> max_connections ~ 1e4) for zero benefit.

No, it's not that bad.

1) With this being allocated in the bss segment,
    the RAM will only be actually be provided on _first use_ --
    so processes that only ever work with small queries will see no 
difference.

2) With temp_buffers' default of 8MB, work_mem using 4MB, etc.,
    using an additional 256kB RAM to 2MB _when needed_ is a good deal
    for about 7% performance improvements.