588951 Query Deployment Count Performance

What does this MR do and why?

Fixes intermittent timeouts on the deploymentCount GraphQL field for groups with many projects and environments (related to #588951).

The existing Postgres query against dora_daily_metrics takes ~1.3 minutes in production. This MR adds a ClickHouse-backed alternative that runs in ~0.4 seconds by querying siphon_deployments and siphon_environments directly using traversal path filtering.

Existing query (~1.3 minutes): https://postgres.ai/console/gitlab/gitlab-production-main/sessions/50482/commands/149922.

New CH query: 0.41 seconds

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.

Related to #588951

Edited by Amr Taha

Merge request reports

Loading