Re: [HACKERS] The number of bytes is stored in index_size of pgstatindex() ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Geoghegan <pg(at)heroku(dot)com>
Cc: 大塚憲司 <otsuka(dot)kenji(at)nttcom(dot)co(dot)jp>, pgsql-docs(at)postgresql(dot)org, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] The number of bytes is stored in index_size of pgstatindex() ?
Date: 2016-02-18 18:01:10
Message-ID: 377.1455818470@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-hackers

Peter Geoghegan <pg(at)heroku(dot)com> writes:
> On Thu, Feb 18, 2016 at 9:40 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> 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

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Peter Geoghegan 2016-02-18 18:35:21 Re: [DOCS] The number of bytes is stored in index_size of pgstatindex() ?
Previous Message Peter Geoghegan 2016-02-18 17:50:20 Re: [HACKERS] The number of bytes is stored in index_size of pgstatindex() ?

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2016-02-18 18:35:21 Re: [DOCS] The number of bytes is stored in index_size of pgstatindex() ?
Previous Message Peter Geoghegan 2016-02-18 17:50:20 Re: [HACKERS] The number of bytes is stored in index_size of pgstatindex() ?