Modify major compaction settings

2025-12-03 09:13:04  Updated

This topic introduces the major compaction parameters and describes how to modify the parameters.

Major compaction parameters

The following table describes the parameters related to major compactions.

Parameter Description Default value Value range
enable_major_freeze Specifies whether to enable major compaction. It is a cluster-level parameter. True
  • True
  • False
major_freeze_duty_time The scheduled time for daily major compactions. It is a cluster-level parameter. 02:00 [00:00,24:00]
major_compact_trigger The number of minor compactions for triggering a major compaction. It is a tenant-level parameter. 0 [0,65535]
default_progressive_merge_num The default major compaction mode specified during table creation. It is a tenant-level parameter. 0 [0, +∞)
  • 0: indicates that 100 progressive compactions are performed by default.
  • 1: indicates that a full compaction will be force executed without executing a progressive compaction.
  • > 1: indicates that the specified number of progressive compactions will be executed when a schema change occurs.

Note

You can also use the ALTER TABLE table_name SET PROGRESSIVE_MERGE_NUM=0; statement to modify the major compaction mode for a table after it is created.

merger_check_interval The interval for checking the major compaction progress of each zone. It is a tenant-level parameter. 10m [10s, 60m]

Modify major compaction parameters by using an SQL statement

  1. Log on to the database as a tenant administrator.

  2. Modify a major compaction parameter.

    Here is an example:

    obclient> ALTER SYSTEM SET major_freeze_duty_time='03:00';
    

Notice

Cluster-level parameters must be set in the sys tenant.

  1. After the parameters are modified, you can execute the SHOW PARAMETERS statement to check whether the modification is successful.

    Here is an example:

    obclient>SHOW PARAMETERS LIKE 'major_freeze_duty_time';
    

Contact Us