-- TwtManager public aggregate methodology v1
-- Run only in a controlled environment. Never export row-level results.
SELECT YEAR(updatedAt) AS year, COUNT(*) AS observations
FROM twtmanager.twtLog
WHERE updatedAt IS NOT NULL
GROUP BY YEAR(updatedAt) ORDER BY year;

SELECT YEAR(runAt) AS year, COUNT(*) AS error_records
FROM twtmanager.apiErrorLog
WHERE runAt IS NOT NULL
GROUP BY YEAR(runAt) ORDER BY year;

-- Feature totals are produced separately for allowlisted result tables, then
-- combined only after suppressing groups with fewer than 20 observations.
