Make stats query selective. Add stats index. Add paging to user list.

Entire-Checkpoint: d42431eee30d
This commit is contained in:
2026-03-12 20:16:55 +01:00
parent 4555fb8a86
commit 8e86e8720d
7 changed files with 194 additions and 175 deletions

View File

@@ -0,0 +1 @@
DROP INDEX IF EXISTS jobs_cluster_user_starttime_stats;

View File

@@ -0,0 +1,10 @@
-- Migration 12: Add covering index for grouped stats queries
-- Column order: cluster (equality), hpc_user (GROUP BY), start_time (range scan)
-- Includes aggregated columns to avoid main table lookups entirely.
DROP INDEX IF EXISTS jobs_cluster_starttime_user_stats;
CREATE INDEX IF NOT EXISTS jobs_cluster_user_starttime_stats
ON job (cluster, hpc_user, start_time, duration, job_state, num_nodes, num_hwthreads, num_acc);
PRAGMA optimize;