-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Closed
Labels
type/enhancementThe issue or PR belongs to an enhancement.The issue or PR belongs to an enhancement.
Description
Enhancement
auto-analyze concurrency is now hardcoded to be 1 which causes auto-analyze runs too slowly and may fail due to exceeding gc-life-time at versions before v6.2
Lines 120 to 135 in 3507a72
| if _, ok := a.plan.(*plan.Analyze); ok && ctx.GetSessionVars().InRestrictedSQL { | |
| oriStats := ctx.GetSessionVars().Systems[variable.TiDBBuildStatsConcurrency] | |
| oriScan := ctx.GetSessionVars().DistSQLScanConcurrency | |
| oriIndex := ctx.GetSessionVars().IndexSerialScanConcurrency | |
| oriIso := ctx.GetSessionVars().Systems[variable.TxnIsolation] | |
| ctx.GetSessionVars().Systems[variable.TiDBBuildStatsConcurrency] = "1" | |
| ctx.GetSessionVars().DistSQLScanConcurrency = 1 | |
| ctx.GetSessionVars().IndexSerialScanConcurrency = 1 | |
| ctx.GetSessionVars().Systems[variable.TxnIsolation] = ast.ReadCommitted | |
| defer func() { | |
| ctx.GetSessionVars().Systems[variable.TiDBBuildStatsConcurrency] = oriStats | |
| ctx.GetSessionVars().DistSQLScanConcurrency = oriScan | |
| ctx.GetSessionVars().IndexSerialScanConcurrency = oriIndex | |
| ctx.GetSessionVars().Systems[variable.TxnIsolation] = oriIso | |
| }() | |
| } |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type/enhancementThe issue or PR belongs to an enhancement.The issue or PR belongs to an enhancement.