Re: Using per-transaction memory contexts for storing decoded tuples
Amit Kapila <amit.kapila16@gmail.com>
From: Amit Kapila <amit.kapila16@gmail.com>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Fujii Masao <masao.fujii@oss.nttdata.com>, "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>,
Shlok Kyal <shlok.kyal.oss@gmail.com>, David Rowley <dgrowleyml@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2024-10-14T06:00:02Z
Lists: pgsql-hackers
On Fri, Oct 11, 2024 at 3:40 AM Masahiko Sawada <sawada.mshk@gmail.com> wrote:
>
> Please find the attached patches.
>
@@ -343,9 +343,9 @@ ReorderBufferAllocate(void)
*/
buffer->tup_context = GenerationContextCreate(new_ctx,
"Tuples",
- SLAB_LARGE_BLOCK_SIZE,
- SLAB_LARGE_BLOCK_SIZE,
- SLAB_LARGE_BLOCK_SIZE);
+ SLAB_DEFAULT_BLOCK_SIZE,
+ SLAB_DEFAULT_BLOCK_SIZE,
+ SLAB_DEFAULT_BLOCK_SIZE);
Shouldn't we change the comment atop this change [1] which states that
we should benchmark the existing values?
One more thing we kept the max size as SLAB_DEFAULT_BLOCK_SIZE instead
of something like we do with ALLOCSET_DEFAULT_SIZES, so we can
probably write a comment as to why we choose to use the max_size same
as init_size. BTW, can we once try to use the max size as
SLAB_LARGE_BLOCK_SIZE? Can it lead to the same problem with concurrent
transactions where freeing larger blocks could be a problem, if so, we
can at least write a comment for future reference.
[1] -
/*
* XXX the allocation sizes used below pre-date generation context's block
* growing code. These values should likely be benchmarked and set to
* more suitable values.
*/
--
With Regards,
Amit Kapila.
Commits
-
Reduce memory block size for decoded tuple storage to 8kB.
- 1b9b6cc3456b 18.0 landed
- eef9cc4dc28f 17.1 landed
- 05e982cdc4df 16.5 landed
- 4a675f31868a 15.9 landed
- 5c1ed0a51681 14.14 landed
- cb988b04d063 13.17 landed
- 53fa68b3bc3a 12.21 landed
-
Generational memory allocator
- a4ccc1cef5a0 11.0 cited