Managing a hierarchy of records