diff options
author | Robert Haas | 2017-03-20 19:49:09 +0000 |
---|---|---|
committer | Robert Haas | 2017-03-20 19:49:09 +0000 |
commit | 953477ca3526e28f9aeeb41d23b16eed0084c7d2 (patch) | |
tree | ad1b7373e82044025156843cbc9c80965d44d7f1 /src/backend/access/hash/hashinsert.c | |
parent | bc18126a6bcb85b51dc082c3ef4417dc016ebd9c (diff) |
Fixes for single-page hash index vacuum.
Clear LH_PAGE_HAS_DEAD_TUPLES during replay, similar to what gets done
for btree. Update hashdesc.c for xl_hash_vacuum_one_page.
Oversights in commit 6977b8b7f4dfb40896ff5e2175cad7fdbda862eb spotted
by Amit Kapila. Patch by Ashutosh Sharma.
Bump WAL version. The original patch to make hash indexes write-ahead
logged probably should have done this, and the single page vacuuming
patch probably should have done it again, but better late than never.
Discussion: http://postgr.es/m/CAA4eK1Kd=mJ9xreovcsh0qMiAj-QqCphHVQ_Lfau1DR9oVjASQ@mail.gmail.com
Diffstat (limited to 'src/backend/access/hash/hashinsert.c')
-rw-r--r-- | src/backend/access/hash/hashinsert.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/backend/access/hash/hashinsert.c b/src/backend/access/hash/hashinsert.c index 8b6d0a0ff78..8640e85a5c6 100644 --- a/src/backend/access/hash/hashinsert.c +++ b/src/backend/access/hash/hashinsert.c @@ -374,6 +374,14 @@ _hash_vacuum_one_page(Relation rel, Buffer metabuf, Buffer buf, PageIndexMultiDelete(page, deletable, ndeletable); + /* + * Mark the page as not containing any LP_DEAD items. This is not + * certainly true (there might be some that have recently been marked, + * but weren't included in our target-item list), but it will almost + * always be true and it doesn't seem worth an additional page scan + * to check it. Remember that LH_PAGE_HAS_DEAD_TUPLES is only a hint + * anyway. + */ pageopaque = (HashPageOpaque) PageGetSpecialPointer(page); pageopaque->hasho_flag &= ~LH_PAGE_HAS_DEAD_TUPLES; |