Subscribe to Posts by Email

Subscriber Count

    701

Disclaimer

All information is offered in good faith and in the hope that it may be of use for educational purpose and for Database community purpose, but is not guaranteed to be correct, up to date or suitable for any particular purpose. db.geeksinsight.com accepts no liability in respect of this information or its use. This site is independent of and does not represent Oracle Corporation in any way. Oracle does not officially sponsor, approve, or endorse this site or its content and if notify any such I am happy to remove. Product and company names mentioned in this website may be the trademarks of their respective owners and published here for informational purpose only. This is my personal blog. The views expressed on these pages are mine and learnt from other blogs and bloggers and to enhance and support the DBA community and this web blog does not represent the thoughts, intentions, plans or strategies of my current employer nor the Oracle and its affiliates or any other companies. And this website does not offer or take profit for providing these content and this is purely non-profit and for educational purpose only. If you see any issues with Content and copy write issues, I am happy to remove if you notify me. Contact Geek DBA Team, via geeksinsights@gmail.com

Pages

Oracle Index Splits: What happens when index leaf block is fulland a new key has to insert in the same leaf block

We all know that Oracle maintain index keys as a pointers to the original rows of table and there are different types of indexes (Btree and bitmap), while what if the index entries are getting inserted either last of index leaf blocks or in between of leaf block and those leaf blocks are already full. BTW, for btree indexes you might have already know that logical structure would be root, branch and leaf blocks.

In order to get the index keys inserted into leaf blocks that already full, oracle splits the leaf blocks in two ways.

90-10 Splits

1) Indexes that has monotonically increased values Eg: sequence based ID columns, date,etc, the following btree index has an entries of 1-35 and packed across 10 blocks and there is no room for new entry, if a new value 36 has to be insert

clip_image001[9]

 

Oracle splits the block as below. This is called Index block 90-10 splits. Here the the 35 the old key (assuming approximate of 10% ) split to new block and insert of new key 36 inserted.

 

clip_image001[15]

 

Index block 50-50 Split

2) Indexes that has pairs of values Ex: Names, Regions etc. Here names are sorted with alphabets for example, A,BC etc…. and inserted keys are in between the blocks (not at the end of right most leaf block)

 

clip_image001[21]

 

Now If a user has inserted a row/key with name again a G , here in our case Index leaf block 2, if it is already full, then Oracle will create two index leaf blocks under the same branch splitting the original keys to 50-50 % and then discard the original leaf block. this is called 50-50 leaf Splits.

clip_image001[25]

 

Typically the above is for B-tree indexes and may not exact representation of index structure, but can give some insight about splits

-Thanks

Geek DBA

References:-

http://richardfoote.wordpress.com/

http://hemantoracledba.blogspot.in/2012/05/index-block-splits.html

Comments are closed.