Modify major compaction parameters

2025-12-03 11:18:03  Updated

This topic describes how to modify major compaction parameters.

Major compaction parameters

The following table describes the major compaction parameters.

Parameter Description Default value Value range
enable_major_freeze A cluster-level parameter indicating whether to enable major compactions. True
  • True
  • False
major_freeze_duty_time A tenant-level parameter indicating the time when a major compaction is scheduled to occur every day. 02:00 [00:00,24:00]
major_compact_trigger A tenant-level parameter indicating the number of freezes after which a major compaction is triggered. 0 [0,65535]
default_progressive_merge_num A tenant-level parameter indicating the default number of minor compactions during table creation. 0 [0, +∞)
where:
  • 0 : indicates to use the default value 100.
  • 1: indicates to perform a full major compaction and no progressive major compaction.
  • Greater than 1: indicates to perform a progressive major compaction for the specified number of rounds when the schema changes.

Note

After the table is created, you can execute the ALTER TABLE table_name SET PROGRESSIVE_MERGE_NUM=0; statement to modify the default number of minor compactions.

merger_check_interval A tenant-level parameter indicating the interval for checking the major compaction progress in each zone. 10m [10s, 60m]

Modify major compaction parameters by using an SQL statement

  1. Log in to the database as the tenant administrator.

  2. Execute the following SQL statement to modify the major compaction parameters.

    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 modification, you can execute the SHOW PARAMETERS statement to verify whether the modification is successful.

    Here is an example:

    obclient>SHOW PARAMETERS LIKE 'major_freeze_duty_time';
    

Contact Us