mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 20:42:43 +00:00
probeRollupCoverage runs ahead of the dashboard snapshot, the analytics slices and the comprehensive insights. It read every live row of the account for SELECT DISTINCT type and counted every DAY bucket per type, which the planner served with a sequential scan of measurement_rollups. Walk the distinct types with a recursive CTE along the live index and test coverage with EXISTS. On a copy of a long-lived account the probe drops from 24-50 ms to under 2 ms and returns the same map; an integration test keeps the old query as the oracle.