Note
Adaptive major compaction is supported in OceanBase Database V4.x. Adaptive major compaction is controlled by the
_enable_adaptive_compactionparameter. During adaptive major compaction, the system collects and statistics user queries and writes in real time, and schedules major compaction tasks for partitions as needed. One of the scenarios for triggering adaptive major compaction is when a partition is frequently dumped and reaches the threshold. For more information about adaptive major compaction, see Adaptive major compaction.The
major_compact_triggerparameter specifies the number of freezes that trigger a tenant-level major compaction. Themajor_compact_triggerparameter is at the tenant level. Compared with adaptive major compaction, tenant-level major compaction has a coarser granularity and involves more partitions, consuming 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 changed from the cluster level to the tenant level starting from V4.0.0.
Description
major_compact_trigger specifies the number of freezes that trigger a major compaction.
Privilege requirements
Query the parameter
The
systenant and all user tenants can use theSHOW PARAMETERSstatement or theGV$OB_PARAMETERSview to query the parameter.Modify the parameter
The
systenant and user tenants can modify the parameter.
Attributes
| Attribute | Description |
|---|---|
| Type | Int |
| Default value | 0, which indicates that a major compaction is not triggered regardless of the number of freezes.
NoteThe default value of this parameter changed from 5 to 0 starting from 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 that trigger a tenant-level major compaction to 10.
obclient> ALTER SYSTEM SET major_compact_trigger=10;