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:49:31
Message-ID: 10922.1455821371@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:
> That's odd. Having taken a quick look at pgstatindex_impl(), I dislike
> that it counts the root separately from internal pages. That's not how
> they're actually presented and understood in the code.

Yeah, that seems a bit strange to me as well. Should we change it to
count the root as an internal page, or is that going too far?

Note that it's already the case that in a one-page index (root is also
a leaf), the root will be included in the leaf_pages count. So it
sure seems inconsistent that it's not included in the internal_pages
count when it's not a leaf.

> It's also possible to have more than one root page, since we do a scan
> in physical order, which the code considers. There could be a fast
> root and a true root. Looks like one is counted as deleted, though:

Well, actually, since we don't have write lock on the index it'd be
possible to see zero or multiple roots because the root's location
changes. That's already mentioned in the documentation, if somewhat
obliquely.

regards, tom lane

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Peter Geoghegan 2016-02-18 19:10:55 Re: [DOCS] The number of bytes is stored in index_size of pgstatindex() ?
Previous Message Peter Geoghegan 2016-02-18 18:35:21 Re: [DOCS] 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 19:10:55 Re: [DOCS] The number of bytes is stored in index_size of pgstatindex() ?
Previous Message Peter Geoghegan 2016-02-18 18:35:21 Re: [DOCS] The number of bytes is stored in index_size of pgstatindex() ?