entity key tree optimization