mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2026-03-15 04:17:30 +01:00
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
13 lines
486 B
SQL
13 lines
486 B
SQL
-- Reverse migration 13: Remove covering status indexes, restore 3-col indexes
|
|
|
|
DROP INDEX IF EXISTS jobs_cluster_jobstate_user_stats;
|
|
DROP INDEX IF EXISTS jobs_cluster_jobstate_project_stats;
|
|
DROP INDEX IF EXISTS jobs_cluster_jobstate_subcluster_stats;
|
|
|
|
-- Restore the original 3-col indexes
|
|
CREATE INDEX IF NOT EXISTS jobs_cluster_jobstate_user
|
|
ON job (cluster, job_state, hpc_user);
|
|
|
|
CREATE INDEX IF NOT EXISTS jobs_cluster_jobstate_project
|
|
ON job (cluster, job_state, project);
|