mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2026-03-21 07:17:30 +01:00
fix: simplify stats query condition
- caused expensive subquery without need in frontend
This commit is contained in:
@@ -156,7 +156,7 @@ func (r *JobRepository) buildStatsQuery(
|
||||
|
||||
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")
|
||||
} else {
|
||||
columns = append(columns, "0 AS totalUsers")
|
||||
|
||||
Reference in New Issue
Block a user