From 218f51584d5a9fcdf702bcc7f54b5b65e255c187 Mon Sep 17 00:00:00 2001 From: Teodor Sigaev Date: Thu, 23 Mar 2017 19:38:47 +0300 Subject: Reduce page locking in GIN vacuum GIN vacuum during cleaning posting tree can lock this whole tree for a long time with by holding LockBufferForCleanup() on root. Patch changes it with two ways: first, cleanup lock will be taken only if there is an empty page (which should be deleted) and, second, it tries to lock only subtree, not the whole posting tree. Author: Andrey Borodin with minor editorization by me Reviewed-by: Jeff Davis, me https://commitfest.postgresql.org/13/896/ --- src/backend/access/gin/ginbtree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/backend/access/gin/ginbtree.c') diff --git a/src/backend/access/gin/ginbtree.c b/src/backend/access/gin/ginbtree.c index 538ad5bb587..b02cb8ae58f 100644 --- a/src/backend/access/gin/ginbtree.c +++ b/src/backend/access/gin/ginbtree.c @@ -31,7 +31,7 @@ static void ginFinishSplit(GinBtree btree, GinBtreeStack *stack, /* * Lock buffer by needed method for search. */ -static int +int ginTraverseLock(Buffer buffer, bool searchMode) { Page page; -- cgit v1.2.3