Purpose
This statement is used to initiate a progressive major compaction.
The number of progressive major compactions is determined by the progressive_merge_num parameter of the table. If this parameter is not specified for the table, the default value for the tenant is used.
For tenant-level compactions, only the sys tenant can initiate compactions for other business tenants.
For table-level compactions, a business tenant can initiate compactions for its own tables.
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 to be compacted. |
| tenant_name | The name of the tenant to be compacted. ALL indicates all tenants. |
Examples
Initiate a progressive major compaction for the t1 table.
obclient> OPTIMIZE TABLE t1;
