Skip to content

Fix N+1 in Group milestone view

Thong Kuah requested to merge group_milestones_n_1 into master

What does this MR do?

Fix N+1 in Group milestone view.

Removes namespace from the view, as in fact, we don't even need to pass in the namespace for the polymorphic route.

Related issue: #208094 (closed)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Performance

For 10 issues, before and after were within error margins

For 113 issues, we start to see improvements from performance bar data:

  • 1 query for SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 59 AND "routes"."source_type" = 'Namespace' LIMIT 1 vs 112 queries.
  • ~100ms vs ~340ms pg time
Before After
Screen_Shot_2020-03-02_at_4.39.04_PM Screen_Shot_2020-03-02_at_4.38.33_PM
Screen_Shot_2020-03-02_at_4.41.26_PM Screen_Shot_2020-03-02_at_4.42.12_PM

Manual QA

Links behaves the same as master

Screen_Shot_2020-03-02_at_3.33.21_PM

Screen_Shot_2020-03-02_at_3.34.05_PM

Links behaves the same as master

Screen_Shot_2020-03-02_at_3.34.54_PM

Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading