소스 검색

feat:sql优化

wangchuanjin 2 년 전
부모
커밋
4be53f2084
3개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 1
      pushentchange/src/match/matcher/membermatch.go
  2. 1 1
      pushfollowent/src/match/matcher/match.go
  3. 1 1
      pushfollowproject/src/match/matcher/match.go

+ 1 - 1
pushentchange/src/match/matcher/membermatch.go

@@ -33,7 +33,7 @@ func NewMemberUser(lastTime int64) *MemberUser {
 	}
 }
 func (m *MemberUser) LoadFollowEnts() bool {
-	q := `select * from follow_ent_monitor`
+	q := `select id,s_userid,s_entname,l_createtime from follow_ent_monitor`
 	if len(Config.TestIds) > 0 {
 		q += ` where s_userid in ('` + strings.Join(Config.TestIds, "','") + `')`
 	}

+ 1 - 1
pushfollowent/src/match/matcher/match.go

@@ -24,7 +24,7 @@ func NewFMatchUser() *FMatchUser {
 }
 
 func (m *FMatchUser) OnceUserBatch(batchIndex int, lastId *string, count *int64) (int, map[string]*FollowInfo) {
-	q := `select * from ` + FollowEnt
+	q := `select id,s_userid,s_entname,l_createtime from ` + FollowEnt
 	if len(Config.TestIds) > 0 {
 		q += ` where s_userid in ('` + strings.Join(Config.TestIds, "','") + `')`
 	} else {

+ 1 - 1
pushfollowproject/src/match/matcher/match.go

@@ -175,7 +175,7 @@ func (m *FMatchUser) Match(followInfos map[string]*FollowInfo) {
 
 //
 func (m *FMatchUser) OnceUserBatch(batchIndex int, lastId *string, count *int64) (int, map[string]*FollowInfo) {
-	q := `select * from ` + FollowProject
+	q := `select id,s_id,s_userid,l_createtime,l_lastpushtime from ` + FollowProject
 	if len(Config.TestIds) > 0 {
 		q += ` where s_userid in ('` + strings.Join(Config.TestIds, "','") + `')`
 	} else {