"Cris" <cris(at)dmcid(dot)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