Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Detecting and Fixing Out-of-Balance Indexes

Indexes are Oracle database objects that provide a fast, efficient method of retrieving data from database tables.




Building the Right Environment to Support AI, Machine Learning and Deep Learning

ndexes are Oracle database objects that provide a fast, efficient method of retrieving data from database tables. The physical addresses of required rows can be retrieved from indexes much more efficiently than by reading the entire table. Effective indexing usually results in significant improvements to SQL performance too.

Oracle's default index structure is B*-tree, which stands for "Balanced tree." It has a hierarchical tree structure. At the top is the header. This block contains pointers to the appropriate branch block for any given range of key values. The branch block points either to another branch block, if the index is big, or to an appropriate leaf block. Finally, the leaf block contains a list of key values and physical addresses (ROWIDs) of rows in the database.

Theoretically, any row in a table, even a big one, could be retrieved in a maximum of three or four I/Os (input/output operations): one header block, one or two branch block(s), and one leaf block.

Oracle indexes are not self-balancing. They become fragmented after a large number of INSERTs and DELETEs, which may lead to significant performance degradation. In this 10-Minute Solution I show you how to detect these "out-of-shape" indexes and cure them.

How do you prevent Oracle indexes from becoming fragmented?

Use a PL/SQL stored procedure to detect out-of-balance indexes and rebuild them by utilizing index statistics from the INDEX_STATS view. Run it periodically to keep indexes in your database in good shape.

Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date