summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorFujii Masao2018-07-04 17:21:15 +0000
committerFujii Masao2018-07-04 17:23:46 +0000
commitb41669118c00e25376a6c9ac991e0d074990484a (patch)
tree0cb377e5cac859e25d3144d088d0b468edd37cab /src/include
parentb46727e07a9f4b8e0c8de1f10bfd4986b02c154c (diff)
Improve the performance of relation deletes during recovery.
When multiple relations are deleted at the same transaction, the files of those relations are deleted by one call to smgrdounlinkall(), which leads to scan whole shared_buffers only one time. OTOH, previously, during recovery, smgrdounlink() (not smgrdounlinkall()) was called for each file to delete, which led to scan shared_buffers multiple times. Obviously this could cause to increase the WAL replay time very much especially when shared_buffers was huge. To alleviate this situation, this commit changes the recovery so that it also calls smgrdounlinkall() only one time to delete multiple relation files. This is just fix for oversight of commit 279628a0a7, not new feature. So, per discussion on pgsql-hackers, we concluded to backpatch this to all supported versions. Author: Fujii Masao Reviewed-by: Michael Paquier, Andres Freund, Thomas Munro, Kyotaro Horiguchi, Takayuki Tsunakawa Discussion: https://postgr.es/m/CAHGQGwHVQkdfDqtvGVkty+19cQakAydXn1etGND3X0PHbZ3+6w@mail.gmail.com
Diffstat (limited to 'src/include')
-rw-r--r--src/include/storage/smgr.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/include/storage/smgr.h b/src/include/storage/smgr.h
index 558e4d8518b..c843bbc9692 100644
--- a/src/include/storage/smgr.h
+++ b/src/include/storage/smgr.h
@@ -143,5 +143,6 @@ extern void RememberFsyncRequest(RelFileNode rnode, ForkNumber forknum,
BlockNumber segno);
extern void ForgetRelationFsyncRequests(RelFileNode rnode, ForkNumber forknum);
extern void ForgetDatabaseFsyncRequests(Oid dbid);
+extern void DropRelationFiles(RelFileNode *delrels, int ndelrels, bool isRedo);
#endif /* SMGR_H */