Investigate spikes in total time for notes query
This query with queryid -7445850439771381695
is present in many recent CPU peaks for the primary DB server.
We should investigate if this query contributes to the CPU problem, or just happened to be slowed down by other slow queries when there is a CPU peak.
Queryid | total time 15m | Query |
---|---|---|
{queryid="-7445850439771381695"} | 0.7589705628 | /application:sidekiq,correlation_id:01GWPWXBC6DK0M77NK6YXFS2VX,jid:03dc683fd8012e7c835e3345,endpoint_id:ProcessCommitWorker,db_config_name:main/ SELECT $1 AS one FROM "notes" WHERE "notes"."project_id" = $2 AND "notes"."noteable_type" = $3 AND "notes"."commit_id" = $4 AND "notes"."system" = $5 AND ((note LIKE $6 OR note LIKE $7)) LIMIT $8 |
Note: queryid -3557391251935655493
(#398101 (closed)) is known to contribute to CPU, but this query -7445850439771381695
appears alongside many total time analysis, see https://gitlab.com/gitlab-org/gitlab/-/issues/395711.
- Why does
-7445850439771381695
slow down when-3557391251935655493
slows down ? - Could
-7445850439771381695
be optimized ? - Could
-7445850439771381695
be run less often, or run in replicas ?
Edited by Thong Kuah