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

From Peter Geoghegan
Subject Re: [DOCS] The number of bytes is stored in index_size of pgstatindex() ?
Date
Msg-id CAM3SWZRLfCayENUVE2SqyeAiYKLFO7a7cHK4YbJGj55ZQ2i35w@mail.gmail.com
Whole thread Raw
In response to Re: [DOCS] The number of bytes is stored in index_size of pgstatindex() ?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [DOCS] The number of bytes is stored in index_size of pgstatindex() ?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Thu, Feb 18, 2016 at 10:49 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> 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?

I think we should change it. It seems like a bug to me. I've had the
same point come up ("leaf-ness/internal-ness and root-ness are
orthogonal") a couple of times with Heikki over the years. I just
haven't used pgstattuple very much for some reason, and so didn't
catch it before now.

> 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.

That's what I was thinking.

> 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.

Ah, yes. Another consequence of going in physical order.

--
Peter Geoghegan


pgsql-hackers by date:

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