how to get the height of index tree?

Started by sunpengover 15 years ago4 messagesgeneral
Jump to latest
#1sunpeng
bluevaley@gmail.com

Hi, how to get the height of R* or B tree of created index ?

#2sunpeng
bluevaley@gmail.com
In reply to: sunpeng (#1)
Re: how to get the height of index tree?

what's the base of log*a*(*n*) function ? is that base a=16? or something
else? how to know this base ?

2010/10/22 sunpeng <bluevaley@gmail.com>

Show quoted text

Hi, how to get the height of R* or B tree of created index ?

#3John R Pierce
pierce@hogranch.com
In reply to: sunpeng (#2)
Re: how to get the height of index tree?

On 10/22/10 11:50 AM, sunpeng wrote:

what's the base of log_/a/ (/n/) function ? is that base a=16? or
something else? how to know this base ?

2010/10/22 sunpeng <bluevaley@gmail.com <mailto:bluevaley@gmail.com>>

Hi, how to get the height of R* or B tree of created index ?

it would be based on how many index values plus overhead fits in each 8K
block. highly variable if the field being indexed is TEXT or VARCHAR
or similar.

#4Dimitri Fontaine
dimitri@2ndQuadrant.fr
In reply to: John R Pierce (#3)
Re: how to get the height of index tree?

John R Pierce <pierce@hogranch.com> writes:

2010/10/22 sunpeng <bluevaley@gmail.com <mailto:bluevaley@gmail.com>>

Hi, how to get the height of R* or B tree of created index ?

You could use Gevel for GiST and GIN:

http://www.sai.msu.su/~megera/wiki/Gevel

Don't know if something similar exists for btree, but I guess it would
be very useful.

Regards,
--
Dimitri Fontaine
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support