Note
OceanBase Database V4.x has adaptive major compaction enabled by default (controlled by the
_enable_adaptive_compactionswitch). When adaptive major compaction is enabled, the system will real-time collect and statistics about your queries and writes, and schedule partition merge tasks as needed. A partition merge task will be scheduled for a partition when adaptive major compaction is triggered under the following condition: the partition experiences frequent minor compactions and reaches the specified threshold. For more information about adaptive major compaction, see Adaptive major compaction.The
major_compact_triggerparameter specifies that a tenant merge task will be scheduled when the number of freezes in the tenant reaches the specified threshold. Note that themajor_compact_triggerparameter applies at the tenant level, whereas adaptive major compaction applies at the partition level. Therefore, the tenant level merge involves more partitions and consumes more system resources. As a result, if adaptive major compaction is enabled, we recommend that you do not specify themajor_compact_triggerparameter.- The scope of the
major_compact_triggerparameter has been changed from cluster-level to tenant-level since V4.0.0.
Description
The major_compact_trigger parameter specifies the number of freezes that trigger a major compaction.
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 will not be automatically triggered regardless of the number of freezes.
NoteThe default value was changed from 5 to 0 in V4.0.0. |
| Value range | [0, 65535] |
| Modifiable | Yes. You can use the ALTER SYSTEM SET statement to modify it. |
| Takes effect after OBServer node restart | No |
Example
Specify that a major compaction be triggered after 10 freezes.
obclient> ALTER SYSTEM SET major_compact_trigger=10;
