You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, if you set tidb_auto_analyze_ratio to 0, we will disable auto-analysis based on row changes, but we will still process the newly added indexes and tables.
This behavior is difficult to understand. I suppose most users will think 0 means we always need to analyze the table, no matter how many rows have been updated.
The historic reason we introduced it is that before #34643 this PR, there was no way to disable the auto-analyze feature without restarting the server. So we chose this special value to allow users to disable the auto-analysis feature. But now enable_tidb_auto_analyze is a global session variable. So we don't depend on this value.
So Roger and I suggest getting rid of this old behavior. No longer allow users to set it to zero.
However, I am not sure how to deal with the existing users' settings.
I think we have the following choices:
Help users to set enable_tidb_auto_analyze to off if the user's tidb_anto_analyze_ratio is 0.
Keep the old implementation and also keep the user's settings during the upgrade process. But we don't allow changing this value to 0 anymore.
The text was updated successfully, but these errors were encountered:
I believe the case setting tidb_anto_analyze_ratio to 0 is rare.
In addition, we can add extra comment in user doc of tidb_anto_analyze_ratio. If users want to completely disable auto analyze, go for enable_tidb_auto_analyze instead of setting tidb_anto_analyze_ratio to 0.
Enhancement
Currently, if you set tidb_auto_analyze_ratio to 0, we will disable auto-analysis based on row changes, but we will still process the newly added indexes and tables.
This behavior is difficult to understand. I suppose most users will think 0 means we always need to analyze the table, no matter how many rows have been updated.
The historic reason we introduced it is that before #34643 this PR, there was no way to disable the auto-analyze feature without restarting the server. So we chose this special value to allow users to disable the auto-analysis feature. But now enable_tidb_auto_analyze is a global session variable. So we don't depend on this value.
So Roger and I suggest getting rid of this old behavior. No longer allow users to set it to zero.
However, I am not sure how to deal with the existing users' settings.
I think we have the following choices:
enable_tidb_auto_analyze
to off if the user'stidb_anto_analyze_ratio
is 0.The text was updated successfully, but these errors were encountered: