Purpose
This statement is used to initiate a round of progressive compaction.
The number of rounds for progressive compaction is determined by the table's progressive_merge_num parameter. If this parameter is not configured for a table, the tenant's default value is used.
For tenant-level major compactions, only the sys tenant can initiate a major compaction for other business tenants.
For table-level major compaction, you can initiate it for tables within your own business tenant.
Syntax
OPTIMIZE {
TABLE table_list
| TENANT {ALL | tenant_list}
}
table_list:
table_name [,table_name ...]
tenant_list:
tenant_name [,tenant_name ...]
Parameters
Parameter |
Description |
|---|---|
| table_name | The name of the table undergoing a progressive major compaction. |
| tenant_name | The name of the tenant for which progressive major compaction is performed. ALL Represents all tenants. |
Examples
Perform a progressive merge on table t1.
obclient> OPTIMIZE TABLE t1;