Re: pageinspect: Hash index support
Ashutosh Sharma <ashu.coek88@gmail.com>
From: Ashutosh Sharma <ashu.coek88@gmail.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Jesper Pedersen <jesper.pedersen@redhat.com>,
Tom Lane <tgl@sss.pgh.pa.us>, Mithun Cy <mithun.cy@enterprisedb.com>,
Amit Kapila <amit.kapila16@gmail.com>, Peter Eisentraut <peter.eisentraut@2ndquadrant.com>, Michael Paquier <michael.paquier@gmail.com>,
Jeff Janes <jeff.janes@gmail.com>, Alvaro Herrera <alvherre@2ndquadrant.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2017-02-08T14:25:23Z
Lists: pgsql-hackers
Attachments
- simplify_hash_bitmap_info_pageinspect.patch (application/x-download) patch
>> 1) Check if an overflow page is a new page. If so, read a bitmap page >> to confirm if a bit corresponding to this overflow page is clear or >> not. For this, I would first add Assert statement to ensure that the >> bit is clear and if it is, then set the statusbit as false indicating >> that the page is free. >> >> 2) In case if an overflow page is not new, first verify if it is >> really an overflow page and if so, check if the bit corresponding to >> it in the bitmap page is SET. If so, set the statusbit as true; If >> not, we would see an assertion failure happening. > > I think this is complicated and not what anybody wants. I think you > should do exactly what I said above: return true if the bit is set in > the bitmap, and false if it isn't. Full stop. Don't read or do > anything with the underlying page. Only read the bitmap page. > Okay, As per the inputs from you, I have modified hash_bitmap_info() and have tried to keep the things simple. Attached is the patch that has this changes. Please have a look and let me know if you feel it is not yet in the right shape. Thanks.
Commits
-
Fix incorrect typecast.
- b4316928d57b 10.0 landed
-
In pageinspect/hashfuncs.c, avoid crashes on alignment-picky machines.
- 14e9b18fed28 10.0 landed
-
pageinspect: Support hash indexes.
- 08bf6e529587 10.0 landed
-
Add uuid to the set of types supported by contrib/btree_gist.
- 11da83a0e70d 10.0 cited
-
Allow CREATE EXTENSION to follow extension update paths.
- 40b449ae84dc 10.0 cited