Fix N+1 in Group milestone view
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
-
Changelog entry - [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
- [-] Separation of EE specific content
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 |
---|---|
Manual QA
- Group (with sub-groups) milestone page : http://localhost:3333/groups/hello/-/milestones/1
- Project milestone page: http://localhost:3333/twitter/flight/-/milestones/1?title=v0.0
- Dashboard milestone page. Can't access individual milestone pages ? Can only get to http://localhost:3333/dashboard/milestones
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process.
Edited by 🤖 GitLab Bot 🤖