Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1boZwI-0002Rg-Cl for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Sep 2016 17:43:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1boZwH-0007il-Va for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Sep 2016 17:43:38 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1boZuu-000670-8f for pgsql-hackers@postgresql.org; Mon, 26 Sep 2016 17:42:12 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1boZur-0005Gp-OT for pgsql-hackers@postgresql.org; Mon, 26 Sep 2016 17:42:11 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D1F6531B315; Mon, 26 Sep 2016 17:42:07 +0000 (UTC) Received: from localhost.localdomain (vpn-54-180.rdu2.redhat.com [10.10.54.180]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u8QHg6K9007855 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 26 Sep 2016 13:42:06 -0400 Subject: Re: pageinspect: Hash index support To: Amit Kapila References: <20160830170633.GA508711@alvherre.pgsql> <0f99b6b0-0e54-0f6e-9502-f8cb6f194c17@redhat.com> <3493caf5-6d50-8915-7612-bd830972f513@redhat.com> <5d64a536-cc90-ce96-b68f-5b6bd3206476@redhat.com> <80a00b5c-56d3-dffb-8dba-edf5d2167b12@2ndquadrant.com> Cc: Peter Eisentraut , Michael Paquier , Ashutosh Sharma , Jeff Janes , Alvaro Herrera , PostgreSQL Hackers From: Jesper Pedersen Organization: JBoss, by Red Hat Message-ID: <91ef3f46-4180-13e1-eb33-eb3eac10307f@redhat.com> Date: Mon, 26 Sep 2016 13:42:06 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 26 Sep 2016 17:42:07 +0000 (UTC) X-Pg-Spam-Score: -9.9 (---------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org 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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers