Skip to content

Services query takes >40% of total time on replicas

The latest postgres-checkup reports a query around services taking up >40% of total time (!) on each of the replicas:

https://gitlab.com/gitlab-com/gl-infra/infrastructure/snippets/1980051#replica-1022016101-6

SELECT "services".\* FROM "services"   
WHERE "services"."instance" = $1   
AND "services"."type" IN ($2, $3,  
$4, $5, $6, $7, $8, $9, $10, $11,  
$12, $13, $14, $15, $16, $17,   
$18, $19, $20, $21, $22, $23, $24,  
$25, $26, $27, $28, $29, $30,   
$31, $32, $33, $34, $35, $36) /\*application:web,  
controller:merge_requests,action:ci_environments_status,  
correlation_id:JVjfA7RuJQa\*/
Edited by Andreas Brandl