You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Query Store backfill: the candidate database list aggregates up to four days of raw rows per server per tick #4662
The Query Store backfill worker lists its candidate databases for each server on every tick with SELECT DISTINCT database_name FROM query_store_stats WHERE server_id = $1 AND collection_time > $2 ORDER BY database_name (QueryStoreBackfill.CandidateSql). $2 reaches back up to the raw tier's horizon, about four days. So each call aggregates up to four days of one server's raw Query Store rows, including compressed chunks, to return a handful of names.
Measured
On one production store, pg_stat_statements over four days: 47,599 calls, 96 ms mean, 4,563 s total, and 5.65 billion shared blocks hit (about 118,000 per call), plus 88 M read.
Expected
The same database list, from a read that doesn't aggregate the whole window. For example, a loose index scan down the existing (server_id, database_name, …) index, one probe per database. The result must be identical to today's, including databases known only through a pending backfill hole.
Activity
Query Store backfill: pin the extra-name cost, a recorded hole on a D…
Query Store backfill: the per-tick database list no longer walks the …