Overview
undo_retention specifies the range of multi-version data that the system should retain, controlling the recycling of multi-version data during minor compactions.
Privilege requirements
Query parameters
Both the
systenant and all user tenants can query this parameter using theSHOW PARAMETERSstatement or theGV$OB_PARAMETERSview.Modify parameters
Both the
systenant and user tenants can modify this parameter.
Attributes
Attribute |
Description |
|---|---|
| Parameter type | Int |
| Default Value | 1,800 seconds |
| Value range | [0, 4294967295] |
| Modifiable | Yes, you can use theALTER SYSTEM SETStatement modification. |
| Whether to restart the OBServer node for the change to take effect | No, the setting takes effect immediately. |
Usage instructions
The data compacted by OceanBase AI Database retains multiple versions of historical data rows. You can use the undo_retention parameter to control the range of multi-version data retained during a minor compaction.
Where:
When the value of
undo_retentionis0, multi-version minor compaction is not enabled. In this case, only the row data of the current latest version is retained in the minor compaction file.When the value of
undo_retentionis greater than0, multi-version minor compaction is enabled, and minor compaction files retain row data from multiple versions within this period (in seconds).Notice
After multi-version minor compaction is enabled for a tenant, major compactions will retain the corresponding incremental minor compaction files. However, the major SSTable will not store multi-version data. It is recommended not to set this parameter too high to prevent the number of retained SSTables from exceeding the limit.
Configuration example
Set the multi-version data retention period for the system to 1800 seconds.
obclient> ALTER SYSTEM SET undo_retention=1800;