pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Geoghegan <pg@heroku.com>
Cc: 大塚憲司 <otsuka.kenji@nttcom.co.jp>
Cc: pgsql-docs@postgresql.org, Pg Hackers <pgsql-hackers@postgresql.org>
Subject: Re: [HACKERS] The number of bytes is stored in index_size of pgstatindex() ?
Date: Thu, 18 Feb 2016 13:49:31 -0500
Message-ID: <10922.1455821371@sss.pgh.pa.us> (raw)
In-Reply-To: <CAM3SWZT2UaCTqpd71uhUVQN7b7k4treyzGyQLpv4N=TYU=F7tg@mail.gmail.com>
References: <56C5B2C7.7010604@nttcom.co.jp>
	<31925.1455817248@sss.pgh.pa.us>
	<CAM3SWZQtQ2WDGRqa2g_dbfHuu9CebfWvJ_XpXggFoFG1mUYzXw@mail.gmail.com>
	<377.1455818470@sss.pgh.pa.us>
	<CAM3SWZT2UaCTqpd71uhUVQN7b7k4treyzGyQLpv4N=TYU=F7tg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-docs>

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


-- 
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs



view thread (19+ messages)  latest in thread

Message-ID: <10922.1455821371@sss.pgh.pa.us>
Permalink:  ../10922.1455821371@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/10922.1455821371@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pg@heroku.com, otsuka.kenji@nttcom.co.jp, pgsql-hackers@postgresql.org
  Subject: Re: [HACKERS] The number of bytes is stored in index_size of pgstatindex() ?
  In-Reply-To: <10922.1455821371@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox