Note
This parameter is introduced as a system variable since OceanBase Database V2.1.
Description
undo_retention specifies the time range in seconds 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 | INT
NoteStarting from OceanBase Database V4.0.0, the parameter type is changed from system variable to parameter. |
| Default value | 1800 |
| Value range | [0, 4294967295] |
| Modifiable | Yes. It can be modified using the ALTER SYSTEM SET statement. |
| 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.
Examples
obclient> ALTER SYSTEM SET undo_retention=1800;