Skip to content

Add index to external status checks for id and project_id

What does this MR do and why?

The API projects/:id/external_status_checks was breaching the default threshold of 1s and thus impacting the error budget. On investigating we realised that a better index can improve the performance of the database query.

  1. Existing query - https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/21238/commands/69277
  2. Index creation - https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/21238/commands/69278
  3. Query with index - https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/21238/commands/69279

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #421379 (closed)

Merge request reports