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 collect and statistics on user queries and writes in real time and schedule partition merge tasks as needed. A partition merge task is scheduled for a partition when adaptive major compaction is triggered due to frequent minor compactions in the partition, which 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 is scheduled when the number of freezes in a tenant reaches the specified threshold. The control scope of themajor_compact_triggerparameter is the tenant. Compared with adaptive major compaction, tenant-level major compaction operates on a coarser granularity and involves more partitions, thus consuming more system resources. Therefore, we recommend that you do not set themajor_compact_triggerparameter when adaptive major compaction is enabled.- The parameter scope is changed from cluster-level to tenant-level in 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 this parameter.Modify the parameter
Users in the
systenant and user tenants can modify this 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.
NoteThe default value is changed from 5 to 0 in V4.0.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;