From af7572f9236d713a1a4691b8ab87358d37ab647e Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Sat, 15 Jun 2024 10:33:20 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B4=A2=E5=BC=95=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dbproxy/svc/l_coinlog.go | 3 ++- dbproxy/svc/l_gamedetailed.go | 4 +++- dbproxy/svc/l_gameplayerlistlog.go | 6 +++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/dbproxy/svc/l_coinlog.go b/dbproxy/svc/l_coinlog.go index bf31201..25e7811 100644 --- a/dbproxy/svc/l_coinlog.go +++ b/dbproxy/svc/l_coinlog.go @@ -30,8 +30,9 @@ func CoinLogsCollection(plt string) *mongo.Collection { c_coinlogrec.EnsureIndex(mgo.Index{Key: []string{"seqno"}, Background: true, Sparse: true}) c_coinlogrec.EnsureIndex(mgo.Index{Key: []string{"gamefreeid"}, Background: true, Sparse: true}) c_coinlogrec.EnsureIndex(mgo.Index{Key: []string{"cointype"}, Background: true, Sparse: true}) - c_coinlogrec.EnsureIndex(mgo.Index{Key: []string{"-ts"}, Background: true, Sparse: true}) c_coinlogrec.EnsureIndex(mgo.Index{Key: []string{"ts"}, Background: true, Sparse: true}) + c_coinlogrec.EnsureIndex(mgo.Index{Key: []string{"channel"}, Background: true, Sparse: true}) + c_coinlogrec.EnsureIndex(mgo.Index{Key: []string{"-ts", "logtype", "cointype", "channel"}, Background: true, Sparse: true}) } return c_coinlogrec } diff --git a/dbproxy/svc/l_gamedetailed.go b/dbproxy/svc/l_gamedetailed.go index 4ed0397..7ed14c7 100644 --- a/dbproxy/svc/l_gamedetailed.go +++ b/dbproxy/svc/l_gamedetailed.go @@ -18,14 +18,16 @@ func GameDetailedLogsCollection(plt string) *mongo.Collection { if s != nil { c_gamedetailed, first := s.DB().C(model.GameDetailedLogCollName) if first { + c_gamedetailed.EnsureIndex(mgo.Index{Key: []string{"platform"}, Background: true, Sparse: true}) // 兼容老代码 c_gamedetailed.EnsureIndex(mgo.Index{Key: []string{"gameid"}, Background: true, Sparse: true}) c_gamedetailed.EnsureIndex(mgo.Index{Key: []string{"gamefreeid"}, Background: true, Sparse: true}) c_gamedetailed.EnsureIndex(mgo.Index{Key: []string{"logid"}, Background: true, Sparse: true}) c_gamedetailed.EnsureIndex(mgo.Index{Key: []string{"time"}, Background: true, Sparse: true}) c_gamedetailed.EnsureIndex(mgo.Index{Key: []string{"-time"}, Background: true, Sparse: true}) c_gamedetailed.EnsureIndex(mgo.Index{Key: []string{"ts"}, Background: true, Sparse: true}) - c_gamedetailed.EnsureIndex(mgo.Index{Key: []string{"-ts"}, Background: true, Sparse: true}) c_gamedetailed.EnsureIndex(mgo.Index{Key: []string{"matchid"}, Background: true, Sparse: true}) + c_gamedetailed.EnsureIndex(mgo.Index{Key: []string{"-ts", "gameid"}, Background: true, Sparse: true}) + c_gamedetailed.EnsureIndex(mgo.Index{Key: []string{"-ts", "gamefreeid"}, Background: true, Sparse: true}) } return c_gamedetailed } diff --git a/dbproxy/svc/l_gameplayerlistlog.go b/dbproxy/svc/l_gameplayerlistlog.go index cab93c5..e897ad8 100644 --- a/dbproxy/svc/l_gameplayerlistlog.go +++ b/dbproxy/svc/l_gameplayerlistlog.go @@ -21,6 +21,7 @@ func GamePlayerListLogsCollection(plt string) *mongo.Collection { if s != nil { c_gameplayerlistlog, first := s.DB().C(model.GamePlayerListLogCollName) if first { + c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"platform"}, Background: true, Sparse: true}) // 兼容老代码 c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"snid"}, Background: true, Sparse: true}) c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"channel"}, Background: true, Sparse: true}) c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"promoter"}, Background: true, Sparse: true}) @@ -31,12 +32,15 @@ func GamePlayerListLogsCollection(plt string) *mongo.Collection { c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"gamefreeid"}, Background: true, Sparse: true}) c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"gamedetailedlogid"}, Background: true, Sparse: true}) c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"ts"}, Background: true, Sparse: true}) - c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"-ts"}, Background: true, Sparse: true}) c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"time"}, Background: true, Sparse: true}) c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"-time"}, Background: true, Sparse: true}) c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"name"}, Background: true, Sparse: true}) c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"matchid"}, Background: true, Sparse: true}) c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"matchtype"}, Background: true, Sparse: true}) + c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"-ts", "gameid"}, Background: true, Sparse: true}) + c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"-ts", "gamefreeid"}, Background: true, Sparse: true}) + c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"-ts", "snid", "gameid"}, Background: true, Sparse: true}) + c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"-ts", "snid", "gamefreeid"}, Background: true, Sparse: true}) } return c_gameplayerlistlog }