# TiDB Server System Variable Scope

__*TiDB system configuration scope*__
__*TiDB system variable scope*__
__*zz-BGL*__
__*zz-Jeff*__

There four system variable scope categories
+ `SESSION`
+ `GLOBAL` Persistent, persists to cluster
+ `GLOBAL` Non-Persistent, does NOT persist to cluster, a.k.a `INSTANCE` scope
+ `GLOBAL | SESSION`

![`smart`](SystemParametersScope_aa_005_20230524.png)
----------------------------------------------------------------------------
`TiDB` system variables behave similar to `MySQL`, in that settings apply on a `SESSION` or `GLOBAL` scope:

Changes on a `SESSION` scope will only affect the current session.
- `SESSION`: Changes will take effect immediately for current session only.

Changes on a `GLOBAL` scope apply immediately. If this variable is also `SESSION` scoped, all sessions (including your session) will continue to use their current session value.
- `GLOBAL`: Changes will only take effect for new `TiDB` sessions, all current active sessions will not be affected. The changes will be persistent and will remain in effect after cluster restart. Variables are persisted through `TiKV` store and are not saved in the `TiDB` configuration file.

Several `GLOBAL` variables persist to the `TiDB` cluster: 
- For variables with the `Persists to cluster: Yes` setting, when a global variable is changed, a notification is sent to all `TiDB` servers to refresh their system variable cache. When you add additional `TiDB` servers or restart existing `TiDB` servers, the persisted configuration value is automatically used.
- For variables with the `Persists to cluster: No` setting, changes only apply to the local `TiDB` instance that you are connected to. To retain any values set, you need to specify the variables in your `tidb.toml` configuration file.