@@ -431,7 +431,7 @@ func (e *AnalyzeColumnsExec) handleNDVForSpecialIndexes(ctx context.Context, ind
431431 }
432432 }
433433 }()
434- tasks := e .buildSubIndexJobForSpecialIndex (indexInfos )
434+ tasks := e .buildSubIndexJobForSpecialIndex (ctx , indexInfos )
435435 taskCh := make (chan * analyzeTask , len (tasks ))
436436 pendingJobs := make (map [uint64 ]* statistics.AnalyzeJob , len (tasks ))
437437 for _ , task := range tasks {
@@ -533,11 +533,11 @@ func (e *AnalyzeColumnsExec) subIndexWorkerForNDV(ctx context.Context, taskCh ch
533533
534534// buildSubIndexJobForSpecialIndex builds sub index pushed down task to calculate the NDV information for indexes containing virtual column.
535535// This is because we cannot push the calculation of the virtual column down to the tikv side.
536- func (e * AnalyzeColumnsExec ) buildSubIndexJobForSpecialIndex (indexInfos []* model.IndexInfo ) []* analyzeTask {
536+ func (e * AnalyzeColumnsExec ) buildSubIndexJobForSpecialIndex (ctx context. Context , indexInfos []* model.IndexInfo ) []* analyzeTask {
537537 _ , offset := timeutil .Zone (e .ctx .GetSessionVars ().Location ())
538538 tasks := make ([]* analyzeTask , 0 , len (indexInfos ))
539539 sc := e .ctx .GetSessionVars ().StmtCtx
540- concurrency := adaptiveAnlayzeDistSQLConcurrency (context . Background () , e .ctx )
540+ concurrency := adaptiveAnlayzeDistSQLConcurrency (ctx , e .ctx )
541541 for _ , indexInfo := range indexInfos {
542542 base := baseAnalyzeExec {
543543 ctx : e .ctx ,
0 commit comments