aboutsummaryrefslogtreecommitdiff
path: root/src/include/storage/lmgr.h
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2016-04-08 02:04:46 -0400
committerRobert Haas <rhaas@postgresql.org>2016-04-08 02:04:46 -0400
commit719c84c1be51f3d3fe6049b77ddbaa0c4b58a9a9 (patch)
treec2f4b1501655e50339e3365f267fcce00fd06bbb /src/include/storage/lmgr.h
parent8643b91ecf8f47a1307df4a00d66b2fceada0d6f (diff)
downloadpostgresql-719c84c1be51f3d3fe6049b77ddbaa0c4b58a9a9.tar.gz
postgresql-719c84c1be51f3d3fe6049b77ddbaa0c4b58a9a9.zip
Extend relations multiple blocks at a time to improve scalability.
Contention on the relation extension lock can become quite fierce when multiple processes are inserting data into the same relation at the same time at a high rate. Experimentation shows the extending the relation multiple blocks at a time improves scalability. Dilip Kumar, reviewed by Petr Jelinek, Amit Kapila, and me.
Diffstat (limited to 'src/include/storage/lmgr.h')
-rw-r--r--src/include/storage/lmgr.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/include/storage/lmgr.h b/src/include/storage/lmgr.h
index 975b6f8155d..8288e7d5054 100644
--- a/src/include/storage/lmgr.h
+++ b/src/include/storage/lmgr.h
@@ -53,6 +53,9 @@ extern void UnlockRelationIdForSession(LockRelId *relid, LOCKMODE lockmode);
/* Lock a relation for extension */
extern void LockRelationForExtension(Relation relation, LOCKMODE lockmode);
extern void UnlockRelationForExtension(Relation relation, LOCKMODE lockmode);
+extern bool ConditionalLockRelationForExtension(Relation relation,
+ LOCKMODE lockmode);
+extern int RelationExtensionLockWaiterCount(Relation relation);
/* Lock a page (currently only used within indexes) */
extern void LockPage(Relation relation, BlockNumber blkno, LOCKMODE lockmode);