in reply to Index sorting

I don't really understand the way you want to sort the index.

It seems that you also want to renumber the ID's and keep in a certain way the "primary secondary tertiary" structure but not always.

Perhaps if you explain what kind of index this is and how it is made, we might understand better.

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law