>>If your case is the messages in the thread, that may go dozens of levels deep, and you'd pretty soon hit the limit on the length of the key, and the solution may prove impractical. You're better of with recursing on "if seek- scan while", with just keeping record pointers in local variables. I'm currently writing an utility like that, and it's blazingly fast.
>
>What do you mean by "hit the limit on the length of the key"?
The way I was building those keys meant adding an additional character for each level, and using A, B, C etc within the same level, so a node which would be denoted as 3.1.5.3 would have a key of CAEC; this works fine as long as you don't have too many values within the same level and not too many levels.
In message threading, the number of records within the same level (i.e. messages which are replies to the same message) is quite unpredictable, and so is the number of levels (length of the message-response-response-... chain). Using such a key would probably require more than one character, and with the limitation on the total length of a key, you couldn't do more than 120 levels deep.