Re: [Patch] Optimize dropping of relation buffers using dlist
Kyotaro Horiguchi <horikyota.ntt@gmail.com>
From: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
To: k.jamison@fujitsu.com
Cc: tsunakawa.takay@fujitsu.com, andres@anarazel.de,
amit.kapila16@gmail.com, tgl@sss.pgh.pa.us, thomas.munro@gmail.com,
robertmhaas@gmail.com, tomas.vondra@2ndquadrant.com,
pgsql-hackers@postgresql.org
Date: 2020-11-26T07:40:17Z
Lists: pgsql-hackers
At Thu, 26 Nov 2020 16:18:55 +0900 (JST), Kyotaro Horiguchi <horikyota.ntt@gmail.com> wrote in > + /* Zero the array of blocks because these will all be dropped anyway */ > + MemSet(firstDelBlocks, 0, sizeof(BlockNumber) * n * (MAX_FORKNUM + 1)); > > We don't need to prepare nforks, forks and firstDelBlocks for all > relations before looping over relations. In other words, we can fill > in the arrays for a relation at every iteration of relations. Or even we could call FindAndDropRelFileNodeBuffers() for each forks. It dones't matter in the performance perspective whether the function loops over forks or the function is called for each forks. regrds. -- Kyotaro Horiguchi NTT Open Source Software Center
Commits
-
Fix size overflow in calculation introduced by commits d6ad34f3 and bea449c6.
- 519e4c9ee21a 14.0 landed
-
Optimize DropRelFileNodesAllBuffers() for recovery.
- bea449c635c0 14.0 landed
-
Optimize DropRelFileNodeBuffers() for recovery.
- d6ad34f3410f 14.0 landed
-
Cache smgrnblocks() results in recovery.
- c5315f4f4484 14.0 cited
-
Add a check to prevent overwriting valid data if smgrnblocks() gives a
- ffae5cc5a602 8.2.0 cited