I would advise you to enter a new field for the denormalization of the table. For example, the path field containing the full path from the root of parenta to the current element. For example, to record ID=4 will look like this: "0;1;3". In this case, if you want to get all childrenof element ID=42 will need to obtain the path of the element 42, and then do like '$pathTo42%'. In fact, to parentof ID=42 — like '%;42'
Perhaps attack the idea and not like it slow, they say. But mudkats with recursive samples is not necessary, and the recursion will load server much stronger.
You can go the other way and to every record store and the nesting level will be immediately evident how many requests to perform.
In General, gehlenite about the methods of storage of trees by this thread lots of information.