Note
This parameter was introduced as a system variable in OceanBase Database V2.1.
Description
undo_retention specifies the time range of data versions to be retained by the system. This parameter is used to control the collection of data of multiple versions in minor compactions.
Attributes
| Attribute | Description |
|---|---|
| Type | Integer
NoteThis parameter has been changed from a system variable to a parameter since OceanBase Database V4.0.0. |
| Default value | 1800, in seconds |
| Value range | [0, 4294967295] |
| Modifiable | Yes. You can use the ALTER SYSTEM SET statement to modify the parameter. |
| Effective upon OBServer node restart | No |
Considerations
OceanBase Database retains historical data rows of multiple versions for minor compaction data. You can set undo_retention to control the range of data versions retained in the minor compaction.
Take note of the following considerations:
When
undo_retentionis set to0, multi-version minor compaction is disabled, which indicates that only the latest version of row data is retained in the minor compaction file.When
undo_retentionis set to a value greater than0, multi-version minor compaction is enabled, and multiple versions of row data within the specified period in seconds are retained in the minor compaction file.
Notice
After multi-version minor compaction is enabled for the tenant, the corresponding incremental minor compaction files are retained in a major compaction, but multi-version data is not stored in the Major SSTable To prevent the number of retained SSTable files from exceeding the limit, we recommend that you do not set this parameter to an excessively large value.
Example
obclient> ALTER SYSTEM SET undo_retention=1800;