Re: How many levels a B-tree has? - Mailing list pgsql-general

From Tom Lane
Subject Re: How many levels a B-tree has?
Date
Msg-id 25072.1052930537@sss.pgh.pa.us
Whole thread Raw
In response to How many levels a B-tree has?  ("Cris" <cris@dmcid.net>)
Responses Re: How many levels a B-tree has?  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
List pgsql-general
"Cris" <cris@dmcid.net> writes:
> I need to know (if it possible) how many LEVELS a B-tree index
> has (to know how many accesses to the disk it would do in a query).

In CVS tip we keep track of that information in the index's metapage
(page zero).  But in so-far-released versions it's not explicitly
tracked anywhere.  You'd have to actually chase down the tree from the
root to a leaf to count the levels.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: - what protocol for an Internet postgres connection
Next
From: Fernando Flores Prior
Date:
Subject: Re: - what protocol for an Internet postgres