fix: simplify stats query condition

- caused expensive subquery without need in frontend
This commit is contained in:
Christoph Kluge
2026-03-18 11:07:36 +01:00
parent c1d51959d5
commit 33beb3c806

View File

@@ -156,7 +156,7 @@ func (r *JobRepository) buildStatsQuery(
columns = append(columns, "COUNT(*) as totalJobs") columns = append(columns, "COUNT(*) as totalJobs")
if need("totalUsers") && col != "job.hpc_user" { if need("totalUsers") {
columns = append(columns, "COUNT(DISTINCT job.hpc_user) AS totalUsers") columns = append(columns, "COUNT(DISTINCT job.hpc_user) AS totalUsers")
} else { } else {
columns = append(columns, "0 AS totalUsers") columns = append(columns, "0 AS totalUsers")