Database indexing for the family tree model