Re: B-Tree Levels of IDS
Posted in 1998
Assuming you have a fill factor of 100%, and the number of rows in the table
is N, and the number of rows you can fit on an index page is M, you can get
a good approximation by doing a ln([N/M]) (the natural log of N/M) and
rounding up.
Given N = 32,767 total rows, and M = 4 rows per index page, you'd have:
ln (32,767/4) = ln (8191.75) ~= 9.01 levels = 10 levels.
Remember that each level is exponentially larger than the previous one, so
the top level has one index page, the next two, the next four, etc.
Of course, it's been a REALLY long time since I've used this kind of math,
so I could be wrong here, but I believe this is very close.
sanjeev sagar wrote in message <717mvk$557$1@news.xmission.com>...
>
>
>
>
>
>I think i did not explain my Q very well. Here it is
>again
>
>I want to know the no of btree levels in an index
>even before creating table. I know how many no of
>rows would be in index but i need to know no of btree
>levels in an Index, before create table.
>
>Does it make any sense? In other words any kind of
>theoretical equation?
>
>Thanks
>Sanjeev
>
>---"Art S. Kagel" <kagel@bloomberg.net> wrote:
>>
>> Lucie Janstova wrote:
>>
>> > Try:
>> > select * from sysindexes
>> > where idxname = "my_index";>>
>> This works if the statistics are updated by UPDATE
>STATISTICS LOW ... or
>> UPDATE STATISTICS HIGH... on the table (MEDIUM does
>not update index>> statistics only distributions).
>>
>> > Lucy (lucie.janstova@post.cz)
>>
>> > sanjeev sagar wrote in message
><712vps$33r$1@news.xmission.com>...
>>
>> > >I am using IDS 7.30 on Solaris 2.5.1 I am having
>one Q
>> > >
>> > >How can i find out total no of btree index
>levels, if
>> > >I know the total no of rows in the index?
>>
>> Art S. Kagel
>>
>
>_________________________________________________________
>DO YOU YAHOO!?
>Get your free @yahoo.com address at http://mail.yahoo.com
>