]> granicus.if.org Git - postgresql/commit
Create a "fast path" for acquiring weak relation locks.
authorRobert Haas <rhaas@postgresql.org>
Sat, 28 May 2011 23:52:00 +0000 (19:52 -0400)
committerRobert Haas <rhaas@postgresql.org>
Mon, 18 Jul 2011 04:49:28 +0000 (00:49 -0400)
commit3cba8999b343648c4c528432ab3d51400194e93b
treeef1885a85a6d9b503689235a84d78fbb8c458237
parent7ed8f6c517ba6bada6bfb9a4dd4216e3b97bc2ba
Create a "fast path" for acquiring weak relation locks.

When an AccessShareLock, RowShareLock, or RowExclusiveLock is requested
on an unshared database relation, and we can verify that no conflicting
locks can possibly be present, record the lock in a per-backend queue,
stored within the PGPROC, rather than in the primary lock table.  This
eliminates a great deal of contention on the lock manager LWLocks.

This patch also refactors the interface between GetLockStatusData() and
pg_lock_status() to be a bit more abstract, so that we don't rely so
heavily on the lock manager's internal representation details.  The new
fast path lock structures don't have a LOCK or PROCLOCK structure to
return, so we mustn't depend on that for purposes of listing outstanding
locks.

Review by Jeff Davis.
doc/src/sgml/catalogs.sgml
src/backend/postmaster/postmaster.c
src/backend/storage/lmgr/README
src/backend/storage/lmgr/lock.c
src/backend/storage/lmgr/lwlock.c
src/backend/storage/lmgr/proc.c
src/backend/utils/adt/lockfuncs.c
src/include/catalog/pg_proc.h
src/include/storage/lock.h
src/include/storage/proc.h
src/test/regress/expected/rules.out