From a84bf5bf3548f32ae4dbc6ae51ab1f88971cf341 Mon Sep 17 00:00:00 2001 From: Haibin Xie Date: Wed, 25 Oct 2017 16:51:26 +0800 Subject: [PATCH] executor: use max uint64 as analyze's start timestamp (#4892) --- executor/builder.go | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/executor/builder.go b/executor/builder.go index a35cf158bdda0..710b52ba35a2b 100644 --- a/executor/builder.go +++ b/executor/builder.go @@ -904,10 +904,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 { @@ -959,10 +956,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 { @@ -1021,10 +1015,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, @@ -1033,7 +1023,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), }, @@ -1062,7 +1052,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), },