query_runs holds one row per execution of a scheduled query, identified by its fingerprint query_hash, with started_at (UTC timestamp) and elapsed_ms.
Today is 2024-04-15, and today's runs are still coming in, so leave them out. Compare two windows:
- •recent: runs started from 2024-04-08 00:00 up to (not including) 2024-04-15 00:00;
- •prior: runs started from 2024-04-01 00:00 up to (not including) 2024-04-08 00:00.
A fingerprint has regressed when its median elapsed_ms in the recent window is at least 2× its median in the prior window. Use the median, not the average, so a single outlier run doesn't decide it, and only judge fingerprints with at least 3 runs in each window.
Columns: query_hash, prior_median_ms, recent_median_ms, slowdown (recent_median_ms / prior_median_ms, rounded to 2 decimal places). Sort by slowdown descending, then query_hash.