Skip to content

GitLab Next

    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Menu
    Projects Groups Snippets
  • Get a free trial
  • Sign up
  • Login
  • Sign in / Register
  • GitLab FOSS GitLab FOSS
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar

GitLab 15.0 is launching on May 22! This version brings many exciting improvements, but also removes deprecated features and introduces breaking changes that may impact your workflow. To see what is being deprecated and removed, please visit Breaking changes in 15.0 and Deprecations.

  • GitLab.org
  • GitLab FOSSGitLab FOSS
  • Merge requests
  • !10885
Merged
Created Apr 24, 2017 by Yorick Peterse@yorickpeterseContributor16 of 16 tasks completed16/16 tasks
  • Review changes

  • Download
  • Email patches
  • Plain diff

Rework project authorizations and nested groups for better performance

  • Overview 113
  • Commits 6
  • Pipelines 36
  • Changes 63

This MR reworks the queries used for calculating project authorizations, in particular those used for getting nested groups.

TODO

  • Re-use code in Users::RefreshAuthorizedProjectsService between MySQL and PostgreSQL (as much as possible)
  • Add Group.supports_nested_groups? which returns true for PostgreSQL, false otherwise
  • In the UI use Group.supports_nested_groups? to hide nested groups related UI elements
  • Do something similar in controllers or models (depending on what the best place would be)
  • Add a migration which converts nested groups to regular groups for MySQL, making sure the right people still have access
  • Remove hierarchy related methods that use the old routes setup and are no longer necessary
  • Add documentation stating nested groups can not be supported properly on MySQL

Performance Impact

All tests were performed using the GitLab.com database, on a read-only replica.

Method Before After Notes
Namespace#descendants 580 ms ~1 ms Tests performed using the "gitlab-org" group
Namespace#ancestors ~1 ms ~1 ms Tests performed using the "sub-group-test" group. Old query was a regular index scan

Does this MR meet the acceptance criteria?

  • Changelog entry added, if necessary
  • Documentation created/updated
  • API support added
  • Tests
    • Added for this feature/bug
    • All builds are passing
  • Conform by the merge request performance guides
  • Conform by the style guides
  • Branch has no merge conflicts with master (if it does - rebase it please)
  • Squashed related commits together
Edited May 29, 2017 by Yorick Peterse
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: rework-authorizations-performance