From 33beb3c8066743a43341b30c591d7ec1e5f46412 Mon Sep 17 00:00:00 2001 From: Christoph Kluge Date: Wed, 18 Mar 2026 11:07:36 +0100 Subject: [PATCH] fix: simplify stats query condition - caused expensive subquery without need in frontend --- internal/repository/stats.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/repository/stats.go b/internal/repository/stats.go index 8c0ebc57..0bc85109 100644 --- a/internal/repository/stats.go +++ b/internal/repository/stats.go @@ -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")