From 873af388076e8f6e7bae8b018f1e8e5b1c5cd0b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Mon, 27 Mar 2023 17:14:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9C=8D=E5=8A=A1=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/db/models/server_dao.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/db/models/server_dao.go b/internal/db/models/server_dao.go index fe961d60..89994702 100644 --- a/internal/db/models/server_dao.go +++ b/internal/db/models/server_dao.go @@ -784,9 +784,11 @@ func (this *ServerDAO) CountAllEnabledServersMatch(tx *dbs.Tx, groupId int64, ke } if userId > 0 { query.Attr("userId", userId) + query.UseIndex("userId") } if clusterId > 0 { query.Attr("clusterId", clusterId) + query.UseIndex("clusterId") } if auditingFlag == configutils.BoolStateYes { query.Attr("isAuditing", true) @@ -840,9 +842,11 @@ func (this *ServerDAO) ListEnabledServersMatch(tx *dbs.Tx, offset int64, size in } if userId > 0 { query.Attr("userId", userId) + query.UseIndex("userId") } if clusterId > 0 { query.Attr("clusterId", clusterId) + query.UseIndex("clusterId") } if auditingFlag == 1 { query.Attr("isAuditing", true)