1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +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:
Tom Lane
2012-06-07 17:42:27 -04:00
parent 5baf6da717
commit ece01aae47
9 changed files with 150 additions and 23 deletions

View File

@ -4638,10 +4638,8 @@ xact_redo_commit_internal(TransactionId xid, XLogRecPtr lsn,
ForkNumber fork;
for (fork = 0; fork <= MAX_FORKNUM; fork++)
{
XLogDropRelation(xnodes[i], fork);
smgrdounlink(srel, fork, true);
}
smgrdounlink(srel, true);
smgrclose(srel);
}
@ -4778,10 +4776,8 @@ xact_redo_abort(xl_xact_abort *xlrec, TransactionId xid)
ForkNumber fork;
for (fork = 0; fork <= MAX_FORKNUM; fork++)
{
XLogDropRelation(xlrec->xnodes[i], fork);
smgrdounlink(srel, fork, true);
}
smgrdounlink(srel, true);
smgrclose(srel);
}
}