Re: suboverflowed subtransactions concurrency performance optimize
Simon Riggs <simon.riggs@enterprisedb.com>
From: Simon Riggs <simon.riggs@enterprisedb.com>
To: Andrey Borodin <x4mmm@yandex-team.ru>
Cc: Pengchengliu <pengchengliu@tju.edu.cn>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2022-01-17T13:44:02Z
Lists: pgsql-hackers
Attachments
- subtrans_single_item_cache.v1.patch (application/octet-stream) patch v1
On Tue, 30 Nov 2021 at 12:19, Simon Riggs <simon.riggs@enterprisedb.com> wrote: > > On Mon, 30 Aug 2021 at 11:25, Andrey Borodin <x4mmm@yandex-team.ru> wrote: > > > > Hi Pengcheng! > > > > You are solving important problem, thank you! > > > > > 30 авг. 2021 г., в 13:43, Pengchengliu <pengchengliu@tju.edu.cn> написал(а): > > > > > > To resolve this performance problem, we think about a solution which cache > > > SubtransSLRU to local cache. > > > First we can query parent transaction id from SubtransSLRU, and copy the > > > SLRU page to local cache page. > > > After that if we need query parent transaction id again, we can query it > > > from local cache directly. > > > > A copy of SLRU in each backend's cache can consume a lot of memory. > > Yes, copying the whole SLRU into local cache seems overkill. > > > Why create a copy if we can optimise shared representation of SLRU? > > transam.c uses a single item cache to prevent thrashing from repeated > lookups, which reduces problems with shared access to SLRUs. > multitrans.c also has similar. > > I notice that subtrans. doesn't have this, but could easily do so. > Patch attached, which seems separate to other attempts at tuning. Re-attached, so that the CFapp isn't confused between the multiple patches on this thread. -- Simon Riggs http://www.EnterpriseDB.com/
Commits
-
Revert "Add single-item cache when looking at topmost XID of a subtrans XID"
- b4529005fd38 15.0 landed
-
Add single-item cache when looking at topmost XID of a subtrans XID
- 06f5295af673 15.0 landed
-
Fix handling of partitioned index in RelationGetNumberOfBlocksInFork()
- 0d906b2c0b1f 15.0 cited