Unstacking using hierarchical indexes