diff --git a/pkg/db/migrations/000012_drop_test_daily_totals_date_index.down.sql b/pkg/db/migrations/000012_drop_test_daily_totals_date_index.down.sql new file mode 100644 index 000000000..dc0dca94e --- /dev/null +++ b/pkg/db/migrations/000012_drop_test_daily_totals_date_index.down.sql @@ -0,0 +1,2 @@ +CREATE INDEX IF NOT EXISTS idx_test_daily_totals_date + ON test_daily_totals (date); diff --git a/pkg/db/migrations/000012_drop_test_daily_totals_date_index.up.sql b/pkg/db/migrations/000012_drop_test_daily_totals_date_index.up.sql new file mode 100644 index 000000000..421fde240 --- /dev/null +++ b/pkg/db/migrations/000012_drop_test_daily_totals_date_index.up.sql @@ -0,0 +1,7 @@ +-- idx_test_daily_totals_date exists only to make an unscoped +-- SELECT MAX(date) FROM test_daily_totals fast across ~3,700 partitions. +-- Nothing queries MAX(date) without a release filter anymore +-- (dailysummary.MaxSummaryDate and cumulativesummary.MaxDailySummaryDate +-- were the last two callers), so this index is now pure write overhead: +-- every insert into test_daily_totals maintains it for no reader. +DROP INDEX IF EXISTS idx_test_daily_totals_date; diff --git a/pkg/db/migrations/MANIFEST b/pkg/db/migrations/MANIFEST index 0f67ad014..0c6d1c812 100644 --- a/pkg/db/migrations/MANIFEST +++ b/pkg/db/migrations/MANIFEST @@ -18,3 +18,4 @@ 000009_add_lifecycle_to_prow_job_run_tests 000010_drop_test_analysis_by_job_by_dates 000011_add_lifecycle_to_summaries +000012_drop_test_daily_totals_date_index