IDMS

 View Only

 Index fragmentation measurement

Michael Cairns's profile image
Michael Cairns posted Aug 26, 2026 06:48 AM

Hello all,

We have a question about how other sites manage the issue of indexes becoming fragmented over time.  We have a small number of database AREAs that we know have had issues in the past, and we run a scheduled DB Analyse (program IDMSDBN1) over these to keep an eye on them.  However what we would like to be able to do is run something that gives us a health-check for those AREAs where we have not had problems in the past and might be unaware of the level of index fragmentation present.

Does anyone do this, or have suggestions about what we should be looking for and what might be the best tool or utility to use for something such as this?

Thanks - Mike 

Margaret Sliming's profile image
Margaret Sliming

Hi Mike, an option is to rebuild the index so it's in the same order physically and logically.

1) recompile subschema so membership options are 'OM'.

2) using a batch program, disconnect all of the records from the index set writing a file of key values and DB-KEYS of the record being indexed.

3)  sort file by logical key - descending if records are stored FIFO

4) use another batch program to reconnect the records to the index set.

5) recompile subschema membership options to be 'MA'.

This also helps with performance and avoiding deadlocks.

Tommy Petersen's profile image
Tommy Petersen

DBAN is probably your best bet.  Unfortunately, I am not aware of anything that will tell you how big the issue is, you can get minimum and maximum SR8 sizes and you can derive the average size.  Having many small SR8s will of course hurt updates as they will split more often, which causes orphans and that can become a much bigger issue, but retrieval should be ok as long as the index does not have too many levels.

You can write a program that looks at the line indexes of the index area to see how many small SR8s you have, however you define small.  

I find that the TUNE INDEX utility is great for fixing the issue (as long as there are not many orphans) it can rebalance and resequence the index.  Avoiding orphans is the first step in fixing the issue, by removing the down pointer in system owned indexes that are not optional or manual.  TUNE INDEX can run in CV mode.