mirror of
https://github.com/postgres/postgres.git
synced 2025-11-09 06:21:09 +03:00
Scan the buffer pool just once, not once per fork, during relation drop.
This provides a speedup of about 4X when NBuffers is large enough. There is also a useful reduction in sinval traffic, since we only do CacheInvalidateSmgr() once not once per fork. Simon Riggs, reviewed and somewhat revised by Tom Lane
This commit is contained in:
@@ -1356,12 +1356,8 @@ FinishPreparedTransaction(const char *gid, bool isCommit)
|
||||
for (i = 0; i < ndelrels; i++)
|
||||
{
|
||||
SMgrRelation srel = smgropen(delrels[i], InvalidBackendId);
|
||||
ForkNumber fork;
|
||||
|
||||
for (fork = 0; fork <= MAX_FORKNUM; fork++)
|
||||
{
|
||||
smgrdounlink(srel, fork, false);
|
||||
}
|
||||
smgrdounlink(srel, false);
|
||||
smgrclose(srel);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user