Predicate locking in GIN index Predicate locks are used on per page basis only if fastupdate = off, in opposite case predicate lock on pending list will effectively lock whole index, to reduce locking overhead, just lock a relation. Entry and posting trees are essentially B-tree, so locks are acquired on leaf pages only.
Author: Shubham Barai with some editorization by me and Dmitry Ivanov Review by: Alexander Korotkov, Dmitry Ivanov, Fedor Sigaev Discussion: https://www.postgresql.org/message-id/flat/calxaept5sww+ewtakugfl5_xfcz0mugbcyj70oqbwqr42yk...@mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/43d1ed60fdd96027f044e152176c0d45cd6bf443 Modified Files -------------- src/backend/access/gin/ginbtree.c | 22 + src/backend/access/gin/gindatapage.c | 10 +- src/backend/access/gin/ginget.c | 76 ++- src/backend/access/gin/gininsert.c | 38 +- src/backend/access/gin/ginutil.c | 10 +- src/backend/access/gin/ginvacuum.c | 12 +- src/backend/storage/lmgr/README-SSI | 9 + src/include/access/gin_private.h | 4 +- src/test/isolation/expected/predicate-gin.out | 756 ++++++++++++++++++++++++++ src/test/isolation/isolation_schedule | 1 + src/test/isolation/specs/predicate-gin.spec | 134 +++++ 11 files changed, 1054 insertions(+), 18 deletions(-)