optimize relationship queries to avoid N+1