Optimize retrieving personal and resource access tokens for Credentials inventory index page and API endpoints
What does this MR do and why?
This MR optimizes
- rendering Credentials / Personal access tokens and Credentials / Project and group access tokens tabs
-
GET /groups/:id/manage/personal_access_tokens
andGET /groups/:id/manage/resource_access_tokens
API endpoints requests
by replacing problematic queries with new queries that use new personal_access_tokens.group_id
and personal_access_tokens.user_type
columns. Those columns will be backfilled by
- Set group_id and user_type for human users' per... (#558105 - closed)
- Set group_id and user_type for resource access ... (#558106 - closed)
- Set group_id and user_type for service accounts... (#558108 - closed)
All optimizations are behind optimize_credentials_inventory
FF - we will be able to enalbe it after all BBMs that backfill new columns are completed.
Also, note that this MR does not optimize sorting tokens by name on Credentials inventory index page, we plan to do it separately, see #558112 (comment 2724155627).
References
Database
- Query examples for
GET /groups/:id/manage/personal_access_tokens
: !201312 (comment 2687866934) - Query examples for
GET /groups/:id/manage/resource_access_tokens
: !201312 (comment 2687881351) - Query examples with query plans for Credentials inventory index page: !201312 (comment 2688355362)
-
db:gitlabcom-database-testing
job: !201312 (comment 2727236473)
Screenshots or screen recordings
Before | After |
---|---|
How to set up and validate locally
MR acceptance checklist
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 Bogdan Denkovych