Re: [DOCS] The number of bytes is stored in index_size of pgstatindex() ? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [DOCS] The number of bytes is stored in index_size of pgstatindex() ?
Date
Msg-id 10922.1455821371@sss.pgh.pa.us
Whole thread Raw
In response to Re: [DOCS] The number of bytes is stored in index_size of pgstatindex() ?  (Peter Geoghegan <pg@heroku.com>)
Responses Re: [DOCS] The number of bytes is stored in index_size of pgstatindex() ?  (Peter Geoghegan <pg@heroku.com>)
List pgsql-hackers
Peter Geoghegan <pg@heroku.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


pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: [DOCS] The number of bytes is stored in index_size of pgstatindex() ?
Next
From: Peter Geoghegan
Date:
Subject: Re: [DOCS] The number of bytes is stored in index_size of pgstatindex() ?