Priority - identify and address underperforming SQL queries

In the light of recent database performance issues we have created an epic to address the queries that are either top 10 in time taken or top 10 in the frequency of calls during the monitoring period - Volunteer Research Database Performance Peak queries and create issues (&5652)

Now we are asking teams to review their backlogs (and possibly tribal knowledge) to proactively prioritize and address known query performance issues that are not captured within this epic. This is an urgent request to help reduce the load on our database.

If there are no queries that immediately come to mind for your teams, please take some time to brainstorm some areas of improved efficiencies and reducing database pressure on our primary. What to look for?

  • Known n+1 issues
  • Read-only queries that can be redirected to read-only replicas
  • Opportunities for caching data on frequent reads
  • Lazy loading data (example Lazily load pipeline artifact in project pipelines index page (#324003))
  • Removing or not exact caching costly but not super needed information totally or through a feature flag (so we only turn it off for .com for the time being). See comment below.
  • Unknown unknowns: please think creatively about ways to find and optimize queries, or otherwise relieve DB load!

To Do

Instructions

  1. Please follow the guidance described above.
  2. Create an issue for your team, here are examples - https://gitlab.com/gitlab-com/create-stage/create-engineering-managers/-/issues/131, https://gitlab.com/gitlab-com/create-stage/create-engineering-managers/-/issues/130
  3. Add your team's issue to the table below under Team Audit Issue Link
Team Eng Manager Team Audit Issue Link
Configure @nicholasklick
Create:Editor @rkuba https://gitlab.com/gitlab-com/create-stage/create-engineering-managers/-/issues/128
Create:Source Code BE @sean_carroll -> @nick.thomas https://gitlab.com/gitlab-com/create-stage/create-engineering-managers/-/issues/129
Create:Code Review BE @m_gill https://gitlab.com/gitlab-com/create-stage/create-engineering-managers/-/issues/130
Create:Code Review, Create:Source Code FE @andr3 https://gitlab.com/gitlab-com/create-stage/create-engineering-managers/-/issues/126
Distribution @mendeni
Ecosystem BE @mnohr https://gitlab.com/gitlab-org/ecosystem-team/team-tasks/-/issues/677
Global Search @changzhengliu gitlab-org/search-team/team-tasks#36 (closed)
Growth:Activation, Adoption, Conversion, Expansion @pcalder
Fulfillment:License @jameslopez
Fulfillment:Purchase @chris_baus
Fulfillment:Utilization @csouthard
Geo @nhxnguyen https://gitlab.com/gitlab-com/create-stage/create-engineering-managers/-/issues/131
Gitaly @zj-gitlab
Manage:Access, Import BE @lmcandrew
Manage:Optimize, Compliance BE @djensen
Memory @craig-gomes
Monitor @crystalpoole
Package @dcroft
Plan:Product Planning & Certify @johnhope
Plan:Project Management @jlear
Product Intelligence @jeromezng
Release @nicolewilliams
Secure:Composition Analysis BE @gonzoyumo
Secure:Dynamic Analysis, Fuzz Testing BE @sethgitlab
Secure:Static Analysis BE @twoodham
Threat Management BE @thiagocsf
Verify:CI, Pipeline Authoring BE @cheryl.li
Verify:Runner @erushton
Verify:Testing @rickywiens
Edited by Fabien Catteau