[RUN ALL RSPEC] Enable DISTINCT optimization for ObjectHierarchy globally [RUN AS-IF-FOSS]
This uses the feature flag and work in
!56509 (merged) to ensure
the query planner chooses the nested join instead of the more expensive
hashed join. When the use_distinct_for_all_object_hierarchy
feature flag is
used globally, it will apply to all queries, not just the ones that have
manually enabled them via the options
hash while creating
ObjectHierarchy
.
This change works around a PostgreSQL query planner bug that is detailed in https://gitlab.com/gitlab-com/gl-infra/production/-/issues/3894.
Related issues:
Edited by 🤖 GitLab Bot 🤖