@@ -83,7 +83,8 @@ func (h *Handle) Clear() {
83
83
}
84
84
h .feedback = h .feedback [:0 ]
85
85
h .mu .ctx .GetSessionVars ().InitChunkSize = 1
86
- h .mu .ctx .GetSessionVars ().MaxChunkSize = 32
86
+ h .mu .ctx .GetSessionVars ().MaxChunkSize = 1
87
+ h .mu .ctx .GetSessionVars ().ProjectionConcurrency = 0
87
88
h .listHead = & SessionStatsCollector {mapper : make (tableDeltaMap ), rateMap : make (errorRateDeltaMap )}
88
89
h .globalMap = make (tableDeltaMap )
89
90
h .mu .rateMap = make (errorRateDeltaMap )
@@ -353,6 +354,7 @@ func (h *Handle) indexStatsFromStorage(row chunk.Row, table *statistics.Table, t
353
354
idx := table .Indices [histID ]
354
355
errorRate := statistics.ErrorRate {}
355
356
flag := row .GetInt64 (8 )
357
+ lastAnalyzePos := row .GetDatum (10 , types .NewFieldType (mysql .TypeBlob ))
356
358
if statistics .IsAnalyzed (flag ) {
357
359
h .mu .Lock ()
358
360
h .mu .rateMap .clear (table .PhysicalID , histID , true )
@@ -373,7 +375,7 @@ func (h *Handle) indexStatsFromStorage(row chunk.Row, table *statistics.Table, t
373
375
if err != nil {
374
376
return errors .Trace (err )
375
377
}
376
- idx = & statistics.Index {Histogram : * hg , CMSketch : cms , Info : idxInfo , ErrorRate : errorRate , StatsVer : row .GetInt64 (7 ), Flag : flag , LastAnalyzePos : row . GetDatum ( 10 , types . NewFieldType ( mysql . TypeBlob ) )}
378
+ idx = & statistics.Index {Histogram : * hg , CMSketch : cms , Info : idxInfo , ErrorRate : errorRate , StatsVer : row .GetInt64 (7 ), Flag : flag , LastAnalyzePos : * lastAnalyzePos . Copy ( )}
377
379
}
378
380
break
379
381
}
@@ -392,6 +394,7 @@ func (h *Handle) columnStatsFromStorage(row chunk.Row, table *statistics.Table,
392
394
nullCount := row .GetInt64 (5 )
393
395
totColSize := row .GetInt64 (6 )
394
396
correlation := row .GetFloat64 (9 )
397
+ lastAnalyzePos := row .GetDatum (10 , types .NewFieldType (mysql .TypeBlob ))
395
398
col := table .Columns [histID ]
396
399
errorRate := statistics.ErrorRate {}
397
400
flag := row .GetInt64 (8 )
@@ -429,7 +432,7 @@ func (h *Handle) columnStatsFromStorage(row chunk.Row, table *statistics.Table,
429
432
ErrorRate : errorRate ,
430
433
IsHandle : tableInfo .PKIsHandle && mysql .HasPriKeyFlag (colInfo .Flag ),
431
434
Flag : flag ,
432
- LastAnalyzePos : row . GetDatum ( 10 , types . NewFieldType ( mysql . TypeBlob ) ),
435
+ LastAnalyzePos : * lastAnalyzePos . Copy ( ),
433
436
}
434
437
col .Histogram .Correlation = correlation
435
438
break
@@ -452,7 +455,7 @@ func (h *Handle) columnStatsFromStorage(row chunk.Row, table *statistics.Table,
452
455
ErrorRate : errorRate ,
453
456
IsHandle : tableInfo .PKIsHandle && mysql .HasPriKeyFlag (colInfo .Flag ),
454
457
Flag : flag ,
455
- LastAnalyzePos : row . GetDatum ( 10 , types . NewFieldType ( mysql . TypeBlob ) ),
458
+ LastAnalyzePos : * lastAnalyzePos . Copy ( ),
456
459
}
457
460
break
458
461
}
0 commit comments