Skip site navigation (1) Skip section navigation (2)

pgsql: Create a "fast path" for acquiring weak relation locks.

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Create a "fast path" for acquiring weak relation locks.
Date: 2011-07-18 04:50:15
Message-ID: E1QifmZ-0002KR-Ph@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/3cba8999b343648c4c528432ab3d51400194e93b

Modified Files
--------------
doc/src/sgml/catalogs.sgml          |   39 +-
src/backend/postmaster/postmaster.c |    1 -
src/backend/storage/lmgr/README     |   96 +++-
src/backend/storage/lmgr/lock.c     | 1247 ++++++++++++++++++++++++++++-------
src/backend/storage/lmgr/lwlock.c   |    3 +
src/backend/storage/lmgr/proc.c     |    5 +-
src/backend/utils/adt/lockfuncs.c   |   87 ++--
src/include/catalog/pg_proc.h       |    2 +-
src/include/storage/lock.h          |   27 +-
src/include/storage/proc.h          |   21 +
src/test/regress/expected/rules.out |    2 +-
11 files changed, 1196 insertions(+), 334 deletions(-)

pgsql-committers by date

Next:From: Peter EisentrautDate: 2011-07-18 10:52:50
Subject: Re: Re: [COMMITTERS] pgsql: Add temp_file_limit GUC parameter to constrain temporary file sp
Previous:From: Peter EisentrautDate: 2011-07-18 04:38:27
Subject: pgsql: Remove claim that the project is not represented in the SQLwork

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group