Skip to content

Use self_and_descendant_ids helper

Adam Hegyi requested to merge ah-use-self-descendant-ids into master

What does this MR do and why?

This MR changes the self_and_descendants.select(:id) to use the self_and_descendant_ids helper to locate subgroup ids. In some cases the new version performs better because we have an optimization for loading subgroup ids from a de-normalized table: &11469

If you want to test both versions (optimized, non-optimized) of the self_and_descendant_ids query, you can do the following:

Group.first.self_and_descendant_ids.to_a
Feature.enable(:group_hierarchy_optimization)
# Should run a different query
Group.first.self_and_descendant_ids.to_a

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Adam Hegyi

Merge request reports