RE: [PATCH] Speedup truncates of relation forks
Tsunakawa, Takayuki <tsunakawa.takay@jp.fujitsu.com>
From: "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>
To: 'Masahiko Sawada' <sawada.mshk@gmail.com>, "Jamison, Kirk" <k.jamison@jp.fujitsu.com>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2019-06-14T00:10:07Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Speedup truncations of relation forks.
- 6d05086c0a79 13.0 landed
-
Remove unused smgrdounlinkfork() function.
- 33a94bae605e 13.0 landed
-
Accelerate end-of-transaction dropping of relations
- 279628a0a7cf 9.3.0 cited
From: Masahiko Sawada [mailto:sawada.mshk@gmail.com]
> for (i = 0; i < NBuffers; i++)
> {
> (snip)
> buf_state = LockBufHdr(bufHdr);
>
> /* check with the lower bound and skip the loop */
> if (bufHdr->tag.blockNum < minBlock)
> {
> UnlockBufHdr(bufHdr, buf_state);
> continue;
> }
>
> for (k = 0; k < nforks; k++)
> {
> if (RelFileNodeEquals(bufHdr->tag.rnode, rnode.node) &&
> bufHdr->tag.forkNum == forkNum[k] &&
> bufHdr->tag.blockNum >= firstDelBlock[k])
>
> But since we acquire the buffer header lock after all and the number
> of the internal loops is small (at most 3 for now) the benefit will
> not be big.
Yeah, so I think we can just compare the block number without locking the buffer header here.
Regards
Takayuki Tsunakawa