Skip to content

Commit

Permalink
do not limit auto-analyze concurrency too aggressively
Browse files Browse the repository at this point in the history
  • Loading branch information
chrysan committed Aug 12, 2022
1 parent 61c8438 commit f1c4198
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions executor/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}()
}
Expand Down

0 comments on commit f1c4198

Please sign in to comment.