Why do we do Index rebuild?

By | 07/06/2014
Why do we do Index rebuild? When an indexed field in a table is changed repeatedly, the data is deleted from the index and re-inserted at a new block in the index. The new entries are always added to the right side of the index tree and therefore deletion is relative to the left.
When the index elements are deleted and added repeatedly, the left side of the index tree tends to be sparse and the right side keeps growing.
Fragmented index results in increased usage of database space and more blocks being read into the buffer. This can be avoided by rebuilding the index.
One can measure index fragmentation using the report
  • RSORATAD
  • DB02 –> Detailed Analysis –> Enter Index –> Detailed Analysis –> Analyze Index –> Storage Quality. If storage quality is less than 50% you may need to reorg the index.
  • If you wish to run an analysis on all the indexes, run the report RSORAISQN.
Check SAP note 970538 for more details for more information on the restriction with using this report.
Do not run the report without reading the note. You can also get an idea of the amount of fragmentation by comparing the size of the table and the index. If the size of the index is larger than that of the table, the index is fragmented.

Click on the following link to read more blog posts:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.