0003-Improve-locking-startegy-during-VACUUM-in-Hash-Index.patch
application/x-patch
Filename: 0003-Improve-locking-startegy-during-VACUUM-in-Hash-Index.patch
Type: application/x-patch
Part: 2
Message:
Re: Page Scan Mode in Hash Index
Patch
Format: format-patch
Series: patch 0003
Subject: Improve locking startegy during VACUUM in Hash Index v2
| File | + | − |
|---|---|---|
| src/backend/access/hash/hash.c | 7 | 6 |
From 532287d11f4fd03e78a613cabb6751f8ab22fa59 Mon Sep 17 00:00:00 2001 From: ashu <ashu@localhost.localdomain> Date: Wed, 22 Mar 2017 18:51:22 +0530 Subject: [PATCH] Improve locking startegy during VACUUM in Hash Index v2 Patch by Ashutosh Sharma --- src/backend/access/hash/hash.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/backend/access/hash/hash.c b/src/backend/access/hash/hash.c index 2450ee1..3ac8154 100644 --- a/src/backend/access/hash/hash.c +++ b/src/backend/access/hash/hash.c @@ -841,19 +841,20 @@ hashbucketcleanup(Relation rel, Bucket cur_bucket, Buffer bucket_buf, if (!BlockNumberIsValid(blkno)) break; - next_buf = _hash_getbuf_with_strategy(rel, blkno, HASH_WRITE, - LH_OVERFLOW_PAGE, - bstrategy); - /* - * release the lock on previous page after acquiring the lock on next - * page + * As the hash index scan work in page at a time mode, + * vacuum can release the lock on previous page before + * acquiring lock on the next page. */ if (retain_pin) LockBuffer(buf, BUFFER_LOCK_UNLOCK); else _hash_relbuf(rel, buf); + next_buf = _hash_getbuf_with_strategy(rel, blkno, HASH_WRITE, + LH_OVERFLOW_PAGE, + bstrategy); + buf = next_buf; } -- 1.8.3.1