Skip to content

[RUN ALL RSPEC] Enable DISTINCT optimization for ObjectHierarchy globally [RUN AS-IF-FOSS]

Stan Hu requested to merge sh-global-use-distinct-object-hierarchy into master

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:

  1. gitlab-com/gl-infra/production#4024 (closed)
  2. &5617 (closed)
Edited by 🤖 GitLab Bot 🤖

Merge request reports