Обсуждение: pgsql: Create VXID locks "lazily" in the main lock table.

Поиск
Список
Период
Сортировка

pgsql: Create VXID locks "lazily" in the main lock table.

От
Robert Haas
Дата:
Create VXID locks "lazily" in the main lock table.

Instead of entering them on transaction startup, we materialize them
only when someone wants to wait, which will occur only during CREATE
INDEX CONCURRENTLY.  In Hot Standby mode, the startup process must also
be able to probe for conflicting VXID locks, but the lock need never be
fully materialized, because the startup process does not use the normal
lock wait mechanism.  Since most VXID locks never need to touch the
lock manager partition locks, this can significantly reduce blocking
contention on read-heavy workloads.

Patch by me.  Review by Jeff Davis.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/84e37126770dd6de903dad88ce150a49b63b5ef9

Modified Files
--------------
src/backend/commands/indexcmds.c    |    6 +-
src/backend/postmaster/autovacuum.c |    2 +-
src/backend/storage/ipc/sinvaladt.c |   21 +++--
src/backend/storage/ipc/standby.c   |    2 +-
src/backend/storage/lmgr/README     |   42 +++++--
src/backend/storage/lmgr/lmgr.c     |   64 -----------
src/backend/storage/lmgr/lock.c     |  201 +++++++++++++++++++++++++++++++++++
src/include/storage/lmgr.h          |    5 -
src/include/storage/lock.h          |    4 +
src/include/storage/proc.h          |    2 +
src/include/storage/sinvaladt.h     |    3 +-
11 files changed, 257 insertions(+), 95 deletions(-)