Skip to content

GitLab Next

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
GitLab
GitLab
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 34,943
    • Issues 34,943
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 1,269
    • Merge Requests 1,269
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Metrics
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • GitLab.org
  • GitLabGitLab
  • Merge Requests
  • !26051

Merged
Opened Feb 27, 2020 by Thong Kuah@tkuahMaintainer5 of 5 tasks completed5/5 tasks

Fix N+1 in Group milestone view

  • Overview 19
  • Commits 3
  • Pipelines 9
  • Changes 5

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
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

  • Group (with sub-groups) milestone page : http://localhost:3333/groups/hello/-/milestones/1

✅ 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

  • Project milestone page: http://localhost:3333/twitter/flight/-/milestones/1?title=v0.0

✅ Links behaves the same as master

Screen_Shot_2020-03-02_at_3.34.54_PM

  • 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 Mar 02, 2020 by Thong Kuah
Assignee
Assign to
Reviewer
Request review from
12.9
Milestone
12.9 (Past due)
Assign milestone
Time tracking
Reference: gitlab-org/gitlab!26051
Source branch: group_milestones_n_1

Revert this merge request

This will create a new commit in order to revert the existing changes.

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.

Cherry-pick this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.