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 !
Sent via pgsql-hackers mailing list (email@example.com)
To make changes to your subscription: