New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
executor: make auto analyze more conservative #4284
Conversation
executor/adapter.go
Outdated
ctx.GetSessionVars().Systems[variable.TiDBBuildStatsConcurrency] = "1" | ||
ctx.GetSessionVars().DistSQLScanConcurrency = 1 | ||
ctx.GetSessionVars().IndexSerialScanConcurrency = 1 | ||
ctx.GetSessionVars().Systems[variable.TxnIsolation] = ast.ReadCommitted |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restore the session context after running analyze.
We should investigate why analyze use so many memory. |
@shenli One of the reason is that analyze will open all the sub-executors at begin, but it is not necessary, we need only open those executors when build histograms. |
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PTAL @shenli @hanfei1991 @winoros