Eliminate linear scan in hierarchy