-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
modify tidb_enable_historical_stats behavior #30821
Comments
To whoever picks up this issue, please add deprecation warnings to the deprecated API calls:
|
@An-DJ Please take a look at this issue. |
I have an additional question about this. If we don't persist this variable to the |
Global values are persisted into But actually since ~TiDB 5.2 other servers don't read directly from This cache is important because connectors like to do things like |
Enhancement
In #30646 we merged a new system variable:
tidb_enable_historical_stats
.It uses the functions
getTiDBTableValue()
/setTiDBTableValue()
to persist the saved values to themysql.tidb
table, but for new sysvars we don't need to do this. We should just rely on the built in saving/loading method.The functions
getTiDBTableValue()
/setTiDBTableValue()
are unfortunately required for existing variables related to garbage collection. This is because we do not have clear rules about upgrade/downgrade and need to support earlier versions of TiDB which read/write from these tables and do not use system variables.We can not clean this up these functions until product management to define support versions/upgrade rules (cc @easonn7 ), but it does not have a use for new sysvars.
The advantage of using the built-in method is that the values are cached on each tidb-server in memory. If we add too many rows to the
mysql.tidb
table it will affect performance, because whenSHOW VARIABLES
is executed each value must be read one row at a time.The text was updated successfully, but these errors were encountered: