Skip to content

Commit

Permalink
executor: use max uint64 as analyze's start timestamp (pingcap#4892) (p…
Browse files Browse the repository at this point in the history
  • Loading branch information
alivxxx authored and winoros committed Jan 8, 2018
1 parent c67e2cd commit 6c2fe07
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions executor/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -903,10 +903,7 @@ func (b *executorBuilder) buildCache(v *plan.Cache) Executor {
}

func (b *executorBuilder) buildTableScanForAnalyze(tblInfo *model.TableInfo, pk *model.ColumnInfo, cols []*model.ColumnInfo) Executor {
startTS := b.getStartTS()
if b.err != nil {
return nil
}
startTS := uint64(math.MaxUint64)
table, _ := b.is.TableByID(tblInfo.ID)
keepOrder := false
if pk != nil {
Expand Down Expand Up @@ -958,10 +955,7 @@ func (b *executorBuilder) buildTableScanForAnalyze(tblInfo *model.TableInfo, pk
}

func (b *executorBuilder) buildIndexScanForAnalyze(tblInfo *model.TableInfo, idxInfo *model.IndexInfo) Executor {
startTS := b.getStartTS()
if b.err != nil {
return nil
}
startTS := uint64(math.MaxUint64)
table, _ := b.is.TableByID(tblInfo.ID)
cols := make([]*model.ColumnInfo, len(idxInfo.Columns))
for i, col := range idxInfo.Columns {
Expand Down Expand Up @@ -1020,10 +1014,6 @@ func (b *executorBuilder) buildIndexScanForAnalyze(tblInfo *model.TableInfo, idx
}

func (b *executorBuilder) buildAnalyzeIndexPushdown(task plan.AnalyzeIndexTask) *AnalyzeIndexExec {
startTS := b.getStartTS()
if b.err != nil {
return nil
}
e := &AnalyzeIndexExec{
ctx: b.ctx,
tblInfo: task.TableInfo,
Expand All @@ -1032,7 +1022,7 @@ func (b *executorBuilder) buildAnalyzeIndexPushdown(task plan.AnalyzeIndexTask)
priority: b.priority,
analyzePB: &tipb.AnalyzeReq{
Tp: tipb.AnalyzeType_TypeIndex,
StartTs: startTS,
StartTs: math.MaxUint64,
Flags: statementContextToFlags(b.ctx.GetSessionVars().StmtCtx),
TimeZoneOffset: timeZoneOffset(b.ctx),
},
Expand Down Expand Up @@ -1061,7 +1051,7 @@ func (b *executorBuilder) buildAnalyzeColumnsPushdown(task plan.AnalyzeColumnsTa
keepOrder: keepOrder,
analyzePB: &tipb.AnalyzeReq{
Tp: tipb.AnalyzeType_TypeColumn,
StartTs: b.getStartTS(),
StartTs: math.MaxUint64,
Flags: statementContextToFlags(b.ctx.GetSessionVars().StmtCtx),
TimeZoneOffset: timeZoneOffset(b.ctx),
},
Expand Down

0 comments on commit 6c2fe07

Please sign in to comment.