Re: pageinspect: Hash index support

From: Jesper Pedersen <jesper(dot)pedersen(at)redhat(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pageinspect: Hash index support
Date: 2016-09-26 17:42:06
Message-ID: 91ef3f46-4180-13e1-eb33-eb3eac10307f@redhat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2016-09-26 17:51:21 Re: [PATCH] pgpassfile connection option
Previous Message Jesper Pedersen 2016-09-26 17:39:48 Re: pageinspect: Hash index support