# Persisting Statistics in the TiKV Layer

+ When the database is shut down, all the new version statistics will be written from the cache of TiDB Server to the TiKV cluster

![`smart`](LoadStatistics06_aa_002_20231225.png)

------------------------------------------------------------------------------
During a normal shutdown of the database, all updated statistics are written from the cache of TiDB Server to the TiKV cluster. This ensures that upon the subsequent startup of the database, the statistics remain current.

The following are relevant configuration options and system variables related to statistics handling:
+ `tidb_stats_load_sync_wait` (system variable)
+ `tidb_stats_load_pseudo_timeout` (system variable)
+ `stats-load-concurrency` (configuration option in the TiDB configuration file)
+ `stats-load-queue-size` (configuration option in the TiDB configuration file)