# The prerequisites of TiDB data quick recovery

```
-- configuraton of safe point
SET GLOBAL tidb_gc_life_time = "60m";

-- Query the time point when GC has been cleaned
SELECT * FROM mysql.tidb WHERE variable_name = 'tikv_gc_safe_point';

```
  
![`smart`](PrerequisitesOfQuickRecovery_en_001_20240515.png)

-----------------------------------------------------------------

Although the `MVCC` of TiDB database can save previous versions of the data, if there are too many historical versions, the database capacity will be overloaded. So there is the concept of `safe point` in TiDB. `Safe point` is the concept of a point in time. TiDB's `GC` function will delete historical data before this point in time. That is to say, if the modification time of historical data has exceeded `safe point` in time defined by point, TiDB is impossible to do data quick recover.

Users can set the `safe point` through the parameter `tidb_gc_life_time`. For example, in the slide, set `tidb_gc_life_time` to "60m", and the `safe point` time point is 60 minutes ago. That is to say, data 60 minutes ago may have been cleaned up by the `GC` function, and data quick recovery was not supported. Please note that if `tidb_gc_life_time` is set too large, it may cause there is a large amount of historical data and the capacity may be overloaded.

Therefore, when users need to data quick recovery, they must confirm whether the last modified time of the historical data to be recovered exceeds the time point specified by the `saft point`. If it exceeds the time point, it may not be recovered. Users can use the following query to accurately confirm the time point of historical data that the `GC` function should clean:
```
SELECT * FROM mysql.tidb WHERE variable_name = 'tikv_gc_safe_point';
```