This topic describes the major compaction parameters and how to modify the parameters.
Major compaction parameters
The following table describes the parameters related to major compactions.
| Parameter | Description | Default value | Value range |
|---|---|---|---|
| major_freeze_duty_time | The scheduled time for daily major compactions. | 02:00 | [00:00, 24:00] |
| major_compact_trigger | Equivalent to minor_freeze_times. |
5 | [0, 65535] |
| merge_stat_sampling_ratio | The statistics sampling rate in a major compaction. Statistics collection is disabled when it is set to 0. |
100 | [0, 100] |
| merge_thread_count | The number of threads for major compactions. | 0 | [0, 256] |
| enable_merge_by_turn | Specifies whether to enable rotating major compaction. | false |
|
| zone_merge_order | The compaction sequence of zones during a rotating major compaction. | Null | Null |
| zone_merge_concurrency | The number of zones compacted in a concurrent major compaction. | 0 | [0, +∞] |
| default_progressive_merge_num | The default compaction mode specified during table creation. | 0 | [0, +∞)
|
| enable_manual_merge | Specifies whether to enable manual compaction.
Note |
false |
|
| max_kept_major_version_number | The maximum number of major compaction versions retained. | 2 | [1, 16] |
| zone_merge_timeout | The timeout duration for a major compaction of a zone. | 3h | [1s, +∞) |
| merger_check_interval | The interval for checking the major compaction progress of each zone. | 10m | [10s, 60m] |
| merger_completion_percentage | The percentage of zones or data for which the major compaction has completed. | 100 | [5, 100] |
| enable_global_freeze_trigger | Specifies whether to enable automatic triggering of global freeze. If this feature is enabled, a global freeze and major compaction are triggered when the memory occupied by data exceeds the value of the freeze_trigger_percentage parameter. |
false |
|
Starting from V2.4.x, OceanBase Cloud Platform (OCP) allows you to configure the following information for major compactions: the point in time when daily major compactions are triggered, the number of threads for major compactions, the timeout period for major compactions, whether to enable rotating major compaction, and the degree of parallelism of a rotating major compaction. For more information, see "Major compaction management" in the OCP User Guide of the corresponding version.
Modification methods
Modify major compaction parameters by using an SQL statement
Log on to the
systenant as therootuser.Modify a major compaction parameter.
For example:
obclient>ALTER SYSTEM SET major_freeze_duty_time='03:00';After the parameters are modified, you can execute the
SHOW PARAMETERSstatement to check whether the modification is successful.For example:
obclient>SHOW PARAMETERS LIKE 'major_freeze_duty_time';
Modify major compaction parameters in the OCP console
You can modify the following major compaction settings in the OCP console: the point in time when daily major compactions are triggered, the number of threads for major compactions, the timeout period for major compactions, whether to enable rotating major compaction, and the degree of parallelism of a rotating major compaction.
Log on to the OCP console.
The Clusters page automatically appears.
In the Clusters section, find the target cluster and click the cluster name.
The Overview page of the cluster appears.
In the left-side navigation pane, click Compaction Management.
On the Compaction Management page, click the Configuration for Major Compaction tab.
In the upper-right corner of the Major Compaction Strategy section, click Modify.

Modify the parameters as needed.
Click Save.