Files
atalaya/migrations/0003_indexes.sql
dcarrillo 3882a1941a Kick off (#1)
* Kick off
* Update LICENSE copyright
2026-04-11 13:22:36 +02:00

7 lines
429 B
SQL

-- Indexes for status page & aggregation performance
CREATE INDEX idx_checked_at ON check_results(checked_at);
CREATE INDEX idx_hourly_timestamp ON check_results_hourly(hour_timestamp);
-- Optional covering index for aggregation queries
-- Includes all columns needed for hourly aggregation to avoid table lookups
CREATE INDEX idx_checked_at_monitor_covering ON check_results(checked_at, monitor_name, status, response_time_ms);