Enable DISTINCT optimization for ObjectHierarchy globally
This uses the feature flag and work in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56509 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: 1. https://gitlab.com/gitlab-com/gl-infra/production/-/issues/4024 2. https://gitlab.com/groups/gitlab-org/-/epics/5617
Showing
Please register or sign in to comment