Re: pageinspect: Hash index support
Jesper Pedersen <jesper.pedersen@redhat.com>
From: Jesper Pedersen <jesper.pedersen@redhat.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>,
Michael Paquier <michael.paquier@gmail.com>,
Ashutosh Sharma <ashu.coek88@gmail.com>,
Jeff Janes <jeff.janes@gmail.com>,
Alvaro Herrera <alvherre@2ndquadrant.com>,
PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2016-09-26T17:42:06Z
Lists: pgsql-hackers
On 09/23/2016 01:56 AM, Amit Kapila wrote: > While looking at patch, I noticed below code which seems somewhat problematic: > > + stat->max_avail = BLCKSZ - (BLCKSZ - phdr->pd_special + SizeOfPageHeaderData); > + > + /* page type (flags) */ > + if (opaque->hasho_flag & LH_META_PAGE) > + stat->type = 'm'; > + else if (opaque->hasho_flag & LH_OVERFLOW_PAGE) > + stat->type = 'v'; > + else if (opaque->hasho_flag & LH_BUCKET_PAGE) > + stat->type = 'b'; > + else if (opaque->hasho_flag & LH_BITMAP_PAGE) > + stat->type = 'i'; > > In the above code, it appears that you are trying to calculate > max_avail space for all pages in same way. Don't you need to > calculate it differently for bitmap page or meta page as they don't > share the same format as other type of pages? > Correct, however the max_avail calculation was removed in v6, since we don't display average item size anymore. Thanks for the feedback ! Best regards, Jesper
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