Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aWStM-000105-AH for pgsql-docs@arkaria.postgresql.org; Thu, 18 Feb 2016 18:01:28 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aWStL-0005Ev-SF for pgsql-docs@arkaria.postgresql.org; Thu, 18 Feb 2016 18:01:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aWStL-0005Ef-22; Thu, 18 Feb 2016 18:01:27 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aWStA-0004Fx-3H; Thu, 18 Feb 2016 18:01:26 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u1II1AoO000378; Thu, 18 Feb 2016 13:01:11 -0500 From: Tom Lane To: Peter Geoghegan cc: =?UTF-8?B?5aSn5aGa5oay5Y+4?= , pgsql-docs@postgresql.org, Pg Hackers Subject: Re: [HACKERS] The number of bytes is stored in index_size of pgstatindex() ? In-reply-to: References: <56C5B2C7.7010604@nttcom.co.jp> <31925.1455817248@sss.pgh.pa.us> Comments: In-reply-to Peter Geoghegan message dated "Thu, 18 Feb 2016 09:50:20 -0800" Date: Thu, 18 Feb 2016 13:01:10 -0500 Message-ID: <377.1455818470@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-docs Precedence: bulk Sender: pgsql-docs-owner@postgresql.org Peter Geoghegan writes: > On Thu, Feb 18, 2016 at 9:40 AM, Tom Lane wrote: >> I think this is a bug and we ought to fix the code to include the >> metapage in the reported index_size. Thoughts? > I tend to agree, but I think you should note that specifically in the > documentation. I'm in favor of tools like pgstattuple and pageinspect > going into this kind of detail in their documentation generally. Yeah ... the numbers already appear not to add up because the root page is counted in index_size but not any other column, so there's already something worthy of explanation there. Maybe something like "The reported index_size will normally correspond to two more pages than are accounted for by internal_pages + leaf_pages + empty_pages + deleted_pages, because it also includes the index's metapage and root page". regards, tom lane -- Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-docs