Note
OceanBase Database V4.x has the adaptive major compaction feature enabled by default (controlled by the
_enable_adaptive_compactionswitch). When this feature is enabled, the system will collect and statistics on user queries and writes in real time and schedule partition compactions as needed. A scenario that triggers an adaptive major compaction is as follows: If a partition experiences frequent minor compactions and the specified threshold is reached, a partition compaction task is scheduled for the partition. For more information, see Adaptive major compaction.The
major_compact_triggerparameter specifies that a tenant-level major compaction task is scheduled when the number of times the tenant is frozen reaches the threshold. Note that themajor_compact_triggerparameter applies at the tenant level. Compared with the adaptive major compaction feature, tenant-level major compaction has a larger granularity and involves more partitions, which results in higher system resource consumption. Therefore, we recommend that you do not set themajor_compact_triggerparameter when the adaptive major compaction feature is enabled.- As of V4.0.0, the scope of this parameter has been changed from cluster-level to tenant-level.
Description
The major_compact_trigger parameter specifies the number of freezes that must occur before a major compaction is triggered.
Privilege requirements
Query the parameter
Users in the
systenant and all user tenants can use theSHOW PARAMETERSstatement or theGV$OB_PARAMETERSview to query the parameter.Modify the parameter
Users in the
systenant and all user tenants can modify the parameter.
Attributes
| Attribute | Description |
|---|---|
| Parameter type | Int |
| Default value | 0, which specifies that a major compaction is not automatically triggered regardless of the number of freezes.
NoteAs of V4.0.0, the default value has been changed from 5 to 0. |
| Value range | [0, 65535] |
| Modifiable | Yes. It can be modified by using the ALTER SYSTEM SET statement. |
| Takes effect after OBServer node restart | No |
Example
A major compaction is triggered after 10 freezes.
obclient> ALTER SYSTEM SET major_compact_trigger=10;