Try to optimize the parent/child relationship calculation when possible.