diff --git a/dbproxy/svc/l_coinlog.go b/dbproxy/svc/l_coinlog.go index 619fe04..bf31201 100644 --- a/dbproxy/svc/l_coinlog.go +++ b/dbproxy/svc/l_coinlog.go @@ -30,6 +30,7 @@ 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}) } return c_coinlogrec diff --git a/dbproxy/svc/l_gamedetailed.go b/dbproxy/svc/l_gamedetailed.go index 0b248ec..4ed0397 100644 --- a/dbproxy/svc/l_gamedetailed.go +++ b/dbproxy/svc/l_gamedetailed.go @@ -22,7 +22,10 @@ func GameDetailedLogsCollection(plt string) *mongo.Collection { 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}) } return c_gamedetailed } diff --git a/dbproxy/svc/l_gameplayerlistlog.go b/dbproxy/svc/l_gameplayerlistlog.go index ee7b23b..cab93c5 100644 --- a/dbproxy/svc/l_gameplayerlistlog.go +++ b/dbproxy/svc/l_gameplayerlistlog.go @@ -31,8 +31,12 @@ 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}) } return c_gameplayerlistlog } diff --git a/dbproxy/svc/l_itemlog.go b/dbproxy/svc/l_itemlog.go index 23f8225..941fe85 100644 --- a/dbproxy/svc/l_itemlog.go +++ b/dbproxy/svc/l_itemlog.go @@ -14,7 +14,13 @@ func ItemLogsCollection(plt string) *mongo.Collection { c_itemlog, first := s.DB().C(model.ItemLogCollName) if first { c_itemlog.EnsureIndex(mgo.Index{Key: []string{"snid"}, Background: true, Sparse: true}) - c_itemlog.EnsureIndex(mgo.Index{Key: []string{"platform"}, Background: true, Sparse: true}) + c_itemlog.EnsureIndex(mgo.Index{Key: []string{"logtype"}, Background: true, Sparse: true}) + c_itemlog.EnsureIndex(mgo.Index{Key: []string{"itemid"}, Background: true, Sparse: true}) + c_itemlog.EnsureIndex(mgo.Index{Key: []string{"createts"}, Background: true, Sparse: true}) + c_itemlog.EnsureIndex(mgo.Index{Key: []string{"-createts"}, Background: true, Sparse: true}) + c_itemlog.EnsureIndex(mgo.Index{Key: []string{"typeid"}, Background: true, Sparse: true}) + c_itemlog.EnsureIndex(mgo.Index{Key: []string{"gameid"}, Background: true, Sparse: true}) + c_itemlog.EnsureIndex(mgo.Index{Key: []string{"gamefreeid"}, Background: true, Sparse: true}) } return c_itemlog } diff --git a/dbproxy/svc/l_matchlog.go b/dbproxy/svc/l_matchlog.go index 81bd681..c8f59da 100644 --- a/dbproxy/svc/l_matchlog.go +++ b/dbproxy/svc/l_matchlog.go @@ -24,7 +24,10 @@ func MatchLogCollection(plt string) *mongo.Collection { c.EnsureIndex(mgo.Index{Key: []string{"gamefreeid"}, Background: true, Sparse: true}) c.EnsureIndex(mgo.Index{Key: []string{"matchid"}, Background: true, Sparse: true}) c.EnsureIndex(mgo.Index{Key: []string{"starttime"}, Background: true, Sparse: true}) + c.EnsureIndex(mgo.Index{Key: []string{"-starttime"}, Background: true, Sparse: true}) c.EnsureIndex(mgo.Index{Key: []string{"endtime"}, Background: true, Sparse: true}) + c.EnsureIndex(mgo.Index{Key: []string{"-endtime"}, Background: true, Sparse: true}) + c.EnsureIndex(mgo.Index{Key: []string{"sortid"}, Background: true, Sparse: true}) } return c } diff --git a/dbproxy/svc/u_invitescore.go b/dbproxy/svc/u_invitescore.go index 35d0ece..c8eca1f 100644 --- a/dbproxy/svc/u_invitescore.go +++ b/dbproxy/svc/u_invitescore.go @@ -30,6 +30,7 @@ func InviteScoreCollection(plt string) *mongo.Collection { c.EnsureIndex(mgo.Index{Key: []string{"invitesnid"}, Background: true, Sparse: true}) c.EnsureIndex(mgo.Index{Key: []string{"tp"}, Background: true, Sparse: true}) c.EnsureIndex(mgo.Index{Key: []string{"ts"}, Background: true, Sparse: true}) + c.EnsureIndex(mgo.Index{Key: []string{"-ts"}, Background: true, Sparse: true}) c.EnsureIndex(mgo.Index{Key: []string{"weekindex"}, Background: true, Sparse: true}) c.EnsureIndex(mgo.Index{Key: []string{"monthindex"}, Background: true, Sparse: true}) } diff --git a/dbproxy/svc/u_message.go b/dbproxy/svc/u_message.go index 74f713f..c2cc8ec 100644 --- a/dbproxy/svc/u_message.go +++ b/dbproxy/svc/u_message.go @@ -18,6 +18,10 @@ func MessageCollection(plt string) *mongo.Collection { if first { c.EnsureIndex(mgo.Index{Key: []string{"snid"}, Background: true, Sparse: true}) c.EnsureIndex(mgo.Index{Key: []string{"state"}, Background: true, Sparse: true}) + c.EnsureIndex(mgo.Index{Key: []string{"mtype"}, Background: true, Sparse: true}) + c.EnsureIndex(mgo.Index{Key: []string{"srcid"}, Background: true, Sparse: true}) + c.EnsureIndex(mgo.Index{Key: []string{"-creatts"}, Background: true, Sparse: true}) + c.EnsureIndex(mgo.Index{Key: []string{"creatts"}, Background: true, Sparse: true}) } return c } diff --git a/dbproxy/svc/u_player.go b/dbproxy/svc/u_player.go index 90be6df..360a28c 100644 --- a/dbproxy/svc/u_player.go +++ b/dbproxy/svc/u_player.go @@ -40,13 +40,12 @@ func PlayerDataCollection(plt string) *mongo.Collection { c_playerdata.EnsureIndex(mgo.Index{Key: []string{"snid"}, Unique: true, Background: true, Sparse: true}) c_playerdata.EnsureIndex(mgo.Index{Key: []string{"channel"}, Background: true, Sparse: true}) c_playerdata.EnsureIndex(mgo.Index{Key: []string{"tel"}, Background: true, Sparse: true}) - c_playerdata.EnsureIndex(mgo.Index{Key: []string{"bankaccount"}, Background: true, Sparse: true}) - c_playerdata.EnsureIndex(mgo.Index{Key: []string{"alipayaccount"}, Background: true, Sparse: true}) - c_playerdata.EnsureIndex(mgo.Index{Key: []string{"alipayaccname"}, Background: true, Sparse: true}) - c_playerdata.EnsureIndex(mgo.Index{Key: []string{"bankaccname"}, Background: true, Sparse: true}) c_playerdata.EnsureIndex(mgo.Index{Key: []string{"invitecode"}, Background: true, Sparse: true}) c_playerdata.EnsureIndex(mgo.Index{Key: []string{"invitesnid"}, Background: true, Sparse: true}) c_playerdata.EnsureIndex(mgo.Index{Key: []string{"name"}, Background: true, Sparse: true}) + c_playerdata.EnsureIndex(mgo.Index{Key: []string{"createtime"}, Background: true, Sparse: true}) + c_playerdata.EnsureIndex(mgo.Index{Key: []string{"-createtime"}, Background: true, Sparse: true}) + c_playerdata.EnsureIndex(mgo.Index{Key: []string{"othercode"}, Background: true, Sparse: true}) } return c_playerdata }