Add covering indexes for status/dashboard queries (migration 13)

Adds composite covering indexes on (cluster, job_state, <group_col>, ...)
for user, project, and subcluster groupings to enable index-only scans
for status views. Drops subsumed 3-column indexes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 3d8def28e96e
This commit is contained in:
2026-03-13 13:12:54 +01:00
parent 39ab12784c
commit dd3e5427f4
3 changed files with 32 additions and 1 deletions

View File

@@ -21,12 +21,13 @@ import (
// is added to internal/repository/migrations/sqlite3/.
//
// Version history:
// - Version 13: Add covering indexes for status/dashboard queries (cluster, job_state, ...)
// - Version 12: Add covering index for stats queries (cluster, start_time, hpc_user, ...)
// - Version 11: Optimize job table indexes (reduce from ~78 to 48)
// - Version 10: Node table
//
// Migration files are embedded at build time from the migrations directory.
const Version uint = 12
const Version uint = 13
//go:embed migrations/*
var migrationFiles embed.FS