>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"?