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

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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: [DOCS] The number of bytes is stored in index_size of pgstatindex() ?
Date: 2016-02-18 23:57:00
Message-ID: CAM3SWZQoELpoeniZJFer=QqyscE0G7tYR0LdMi2fX6esm1wXuQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-hackers

On Thu, Feb 18, 2016 at 3:06 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Don't see why; the documentation and field names clearly imply that those
> numbers are accumulated only over leaf pages.

Then I guess what might be lacking is a delineation of what a leaf
page is for the purposes of pgstatindex().

> I certainly wouldn't expect
> the fragmentation measure to include dead pages, for example, since they
> would not get traversed by scans. (Whether the "rightlink points to a
> higher page number" rule for fragmentation is actually very useful is a
> separate question; but as long as that's the measure, only pages that
> are part of the leaf scan sequence should count.)

Why would dead pages not get traversed by scans? It's clear that they
would be traversed to the extent that there will be buffer locking and
inspection of the B-Tree special area flags to determine that the page
should be ignored.

>> Having looked at the 2008 commit d287818eb514d431 myself, ISTM
>> that your intent might well have been to have that happen -- why else
>> would any reasonable person have changed the order at all?
>
> My best guess is that I was thinking that the tests were independent

Dunno. I'd have thought that the basic fact that the ordering had some
significance was fairly obvious. One of the tests is "if
(P_IGNORE(...))", and I can't imagine that not provoking thought.

I'm particular about things like this because I care about making sure
these tools are useful for teaching novice hackers about Postgres
internals. I've made my point and will leave it at that, though.

--
Peter Geoghegan

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Tom Lane 2016-02-19 00:15:22 Re: [DOCS] The number of bytes is stored in index_size of pgstatindex() ?
Previous Message Tom Lane 2016-02-18 23:06:32 Re: [HACKERS] The number of bytes is stored in index_size of pgstatindex() ?

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-02-19 00:15:22 Re: [DOCS] The number of bytes is stored in index_size of pgstatindex() ?
Previous Message Peter Geoghegan 2016-02-18 23:40:23 Re: Remove or weaken hints about "effective resolution of sleep delays is 10 ms"?