Note
Adaptive major compaction is supported in OceanBase Database V4.x. You can enable or disable adaptive major compaction by setting the
_enable_adaptive_compactionparameter. When adaptive major compaction is enabled, the system collects and statistically analyzes the query and write information of users in real time, and schedules partition-level major compaction tasks as needed. One of the scenarios for triggering adaptive major compaction is when a partition is frequently compacted and reaches the threshold. For more information about adaptive major compaction, see Adaptive major compaction.The
major_compact_triggerparameter specifies the number of freezes (the prerequisite for a major compaction) required to trigger a tenant-level major compaction. Themajor_compact_triggerparameter is at the tenant level. Compared with adaptive major compaction, tenant-level major compaction is more granular, involves more partitions, and consumes more system resources. Therefore, we recommend that you do not use themajor_compact_triggerparameter when adaptive major compaction is enabled.- The scope of the
major_compact_triggerparameter was changed from cluster level to tenant level in OceanBase Database V4.0.0.
Description
major_compact_trigger specifies the number of freezes (the prerequisite for a major compaction) required to trigger a major compaction.
Privilege requirements
Query the parameter
You can use the
SHOW PARAMETERSstatement or theGV$OB_PARAMETERSview to query the value of this parameter in thesystenant and all user tenants.Modify the parameter
You can use the
ALTER SYSTEM SETstatement to modify this parameter in thesystenant and all user tenants.
Attributes
| Attribute | Description |
|---|---|
| Type | Int |
| Default value | 0. This means that a major compaction is not triggered regardless of the number of freezes.
NoteThe default value of this parameter was changed from 5 to 0 in OceanBase Database V4.0.0. |
| Value range | [0, 65535] |
| Modifiable | Yes. You can use the ALTER SYSTEM SET statement to modify the parameter. |
| Effective upon OBServer node restart | No. The setting takes effect immediately. |
Examples
Set the number of freezes required to trigger a tenant-level major compaction to 10.
obclient> ALTER SYSTEM SET major_compact_trigger=10;