Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Maximum height of an Oracle B-tree index

RE: Maximum height of an Oracle B-tree index

From: <Jared.Still_at_radisys.com>
Date: Wed, 10 Mar 2004 21:35:01 -0800
Message-ID: <OF54656CE7.650343D2-ON88256E54.0015D6D3-88256E54.001E9615@radisys.com>


For the record, Steve did not make it to blevel of 20, he made it to 14.

Jared

"Jacques Kilchoer" <Jacques.Kilchoer_at_quest.com> Sent by: oracle-l-bounce_at_freelists.org
 03/10/2004 07:01 PM
 Please respond to oracle-l  

        To:     <oracle-l_at_freelists.org>
        cc:     "Richard Foote" <richard.foote_at_bigpond.com>
        Subject:        RE: Maximum height of an Oracle B-tree index


-----Original Message-----
From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org]On Behalf Of Richard Foote Sent: mercredi, 10. mars 2004 14:31
To: oracle-l_at_freelists.org
Subject: Re: Maximum height of an Oracle B-tree index

Hi Jared/Tin and all,  

I believe that was precisely how Steve managed it, very small block size, large pctfree, a bit of cleverness and heaps of storage (until it ran out). He mentioned it btw at the Hotsos tuning class in Sydney last year.  

So far the best I've heard privately is height of 6.  

Can anyone do better ?    

Better than 6? Yes. Better than Steve Adams' record of 20? No, but my tablespace only had 100MB free. I got up to belevel = 14 before running out of space.
I didn't try anything clever, all I did was: 2K blocksize database, large index (maximum length for the Oracle version), pctfree 99, and inserting the index values in descending order.  

Sun Solaris 2.8
Oracle 8.0.6
db_block_size 2K
Index size = 79 MB, blevel = 14  

Proof:
SQL> select value
  2 from v$parameter
  3 where name = 'db_block_size' ;
VALUE



2048  

SQL> column segment_name format a12
SQL> select segment_name, segment_type, bytes, blocks, extents   2 from user_segments
  3 where (segment_name = 'T' and segment_type = 'TABLE')   4 or (segment_name = 'I' and segment_type = 'INDEX') ; SEGMENT_NAME SEGMENT_TYPE BYTES BLOCKS EXTENTS

------------ ----------------- --------- --------- ---------
T            TABLE              20738048     10126       157
I            INDEX              82681856     40372       626
 

SQL> analyze index i compute statistics ; Analizzato indice.
SQL> select

  2     blevel, leaf_blocks, distinct_keys,
  3     avg_leaf_blocks_per_key,
  4     avg_data_blocks_per_key,
  5     clustering_factor, num_rows,
  6     sample_size,
  7     to_char (last_analyzed, 'SYYYY/MM/DD HH24:MI:SS') as last_analyzed
  8 from user_indexes
  9 where index_name = 'I' ;  

   BLEVEL LEAF_BLOCKS DISTINCT_KEYS AVG_LEAF_BLOCKS_PER_KEY AVG_DATA_BLOCKS_PER_KEY

--------- ----------- ------------- ----------------------- 
-----------------------

CLUSTERING_FACTOR NUM_ROWS SAMPLE_SIZE LAST_ANALYZED
----------------- --------- ----------- --------------------
       14       20189         20000                       1        1
            10000     20000           0  2004/03/10 18:50:17
SQL>  
Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Wed Mar 10 2004 - 23:33:26 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US