Significantly optimize children query