Modify major compaction settings

2023-07-28 02:55:42  Updated

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 Valid values
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 will be performed.
  • 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.
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 OceanBase Database as the administrator of the tenant.

  2. Execute the following statement to modify a major compaction parameter.

    Sample code:

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

    Notice

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

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

    Sample code:

    obclient>SHOW PARAMETERS LIKE 'major_freeze_duty_time';
    

Contact Us