And this blog article proposes a interesting and recursion-free alternative of storing the hierarchy information maybe we can try this?