Re: Using per-transaction memory contexts for storing decoded tuples
Fujii Masao <masao.fujii@oss.nttdata.com>
From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Masahiko Sawada <sawada.mshk@gmail.com>,
Amit Kapila <amit.kapila16@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2024-09-19T03:53:48Z
Lists: pgsql-hackers
On 2024/09/19 8:53, Masahiko Sawada wrote: > On Tue, Sep 17, 2024 at 2:06 AM Amit Kapila <amit.kapila16@gmail.com> wrote: >> >> On Mon, Sep 16, 2024 at 10:43 PM Masahiko Sawada <sawada.mshk@gmail.com> wrote: >>> >>> On Fri, Sep 13, 2024 at 3:58 AM Amit Kapila <amit.kapila16@gmail.com> wrote: >>>> >>>> Can we try reducing the size of >>>> 8MB memory blocks? The comment atop allocation says: "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.", so do we need some tuning here? >>> >>> Reducing the size of the 8MB memory block would be one solution and >>> could be better as it could be back-patchable. It would mitigate the >>> problem but would not resolve it. I agree to try reducing it and do >>> some benchmark tests. If it reasonably makes the problem less likely >>> to happen, it would be a good solution. >>> >> >> makes sense. > > I've done some benchmark tests for three different code bases with > different test cases. In short, reducing the generation memory context > block size to 8kB seems to be promising; it mitigates the problem > while keeping a similar performance. Sounds good! I believe the memory bloat issue in the reorder buffer should be considered a bug. Since this solution isn’t too invasive, I think it’s worth considering back-patch to older versions. Then, if we find a better approach, we can apply it to v18 or later. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION
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