Re: Use generation memory context for tuplestore.c

David Rowley <dgrowleyml@gmail.com>

From: David Rowley <dgrowleyml@gmail.com>
To: Alexander Lakhin <exclusion@gmail.com>
Cc: Matthias van de Meent <boekewurm+postgres@gmail.com>, PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2024-07-06T02:05:46Z
Lists: pgsql-hackers
On Sat, 6 Jul 2024 at 12:08, David Rowley <dgrowleyml@gmail.com> wrote:
> The attached fixes the issue. I'll stare at it a bit more and try to
> decide if that's the best way to fix it.

I did that staring work and thought about arranging the code to reduce
the number of #ifdefs. In the end, I decided it was better to keep the
two "if" checks close together so that it's easy to see that one does
> and the other >=. Someone else's tastes may vary.

I adjusted the comment to remove the >= mention and pushed the
resulting patch and backpatched to 16, where I broke this in
0e480385e.

Thanks for the report.

David

David



Commits

  1. Adjust tuplestore.c not to allocate BufFiles in generation context

  2. Fix incorrect sentinel byte logic in GenerationRealloc()

  3. Improve memory management and performance of tuplestore.c

  4. Fix newly introduced issue in EXPLAIN for Materialize nodes

  5. Add memory/disk usage for Material nodes in EXPLAIN