Skip to content

Commit 45a8df2

Browse files
committed
fix: faster queries for DISTINCT values
1 parent d263910 commit 45a8df2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/DIRAC/WorkloadManagementSystem/Agent/JobCleaningAgent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def initialize(self):
8787

8888
def _getAllowedJobTypes(self):
8989
"""Get valid jobTypes"""
90-
result = self.jobDB.getDistinctJobAttributes("JobType")
90+
result = self.jobDB._query("SELECT DISTINCT JobType FROM JobsHistorySummary")
9191
if not result["OK"]:
9292
return result
9393
cleanJobTypes = []

src/DIRAC/WorkloadManagementSystem/DB/JobDB.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1197,7 +1197,7 @@ def getSiteSummary(self):
11971197
waitingList = ['"Submitted"', '"Assigned"', '"Waiting"', '"Matched"']
11981198
waitingString = ",".join(waitingList)
11991199

1200-
result = self.getDistinctJobAttributes("Site")
1200+
result = self._query("SELECT DISTINCT Site FROM JobsHistorySummary")
12011201
if not result["OK"]:
12021202
return result
12031203

0 commit comments

Comments
 (0)