Optimize query builder joins.