Note
OceanBase AI Database supports adaptive compaction, which is controlled by the
_enable_adaptive_compactionswitch. When adaptive compaction is enabled, the system collects and analyzes user query and write activity in real time, and schedules partition compaction tasks as needed. One scenario for triggering adaptive compaction is when a partition experiences frequent minor compactions and exceeds the specified threshold. In that case, a partition compaction task is scheduled for the partition. For detailed operations and instructions on the adaptive compaction feature, see Adaptive Compaction.The
major_compact_triggerparameter specifies that a tenant-level major compaction task is scheduled for a tenant when the number of freezes of the tenant reaches the specified threshold. Themajor_compact_triggerparameter takes effect at the tenant level. Compared with adaptive major compaction, tenant-level major compaction has a larger granularity, involves more partitions, and consumes more system resources. Therefore, we recommend that you disable the adaptive major compaction feature and do not configure themajor_compact_triggerparameter.
Overview
major_compact_trigger specifies how many minor compactions (the precursor to a major compaction) trigger a major compaction.
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 | 0 indicates that a major compaction will not be automatically triggered regardless of the number of freezes. |
| Value range | [0, 65535] |
| 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. |
Configuration example
Configure to trigger a tenant-level major compaction after 10 minor compactions.
obclient> ALTER SYSTEM SET major_compact_trigger=10;