Optimizing query for offspring.
Optimized queries for ancestors.