From f1c4198d0cb9d4fa198e951e08052157e7157e2a Mon Sep 17 00:00:00 2001 From: wuxiaoju Date: Fri, 12 Aug 2022 20:11:32 +0800 Subject: [PATCH] do not limit auto-analyze concurrency too aggressively --- executor/adapter.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/executor/adapter.go b/executor/adapter.go index 6a5b3262c441a..b7f0761f3bc13 100644 --- a/executor/adapter.go +++ b/executor/adapter.go @@ -422,17 +422,11 @@ func (a *ExecStmt) Exec(ctx context.Context) (_ sqlexec.RecordSet, err error) { ctx = util.SetSessionID(ctx, sctx.GetSessionVars().ConnectionID) if _, ok := a.Plan.(*plannercore.Analyze); ok && sctx.GetSessionVars().InRestrictedSQL { oriStats, _ := sctx.GetSessionVars().GetSystemVar(variable.TiDBBuildStatsConcurrency) - oriScan := sctx.GetSessionVars().DistSQLScanConcurrency() - oriIndex := sctx.GetSessionVars().IndexSerialScanConcurrency() oriIso, _ := sctx.GetSessionVars().GetSystemVar(variable.TxnIsolation) terror.Log(sctx.GetSessionVars().SetSystemVar(variable.TiDBBuildStatsConcurrency, "1")) - sctx.GetSessionVars().SetDistSQLScanConcurrency(1) - sctx.GetSessionVars().SetIndexSerialScanConcurrency(1) terror.Log(sctx.GetSessionVars().SetSystemVar(variable.TxnIsolation, ast.ReadCommitted)) defer func() { terror.Log(sctx.GetSessionVars().SetSystemVar(variable.TiDBBuildStatsConcurrency, oriStats)) - sctx.GetSessionVars().SetDistSQLScanConcurrency(oriScan) - sctx.GetSessionVars().SetIndexSerialScanConcurrency(oriIndex) terror.Log(sctx.GetSessionVars().SetSystemVar(variable.TxnIsolation, oriIso)) }() }