Purpose
You can use this statement to initiate a minor or major compaction in the storage layer of a user tenant. You can manually initiate a tenant-level, partition-level, or OBServer node-level minor compaction.
Syntax
alter_system_merge_stmt:
ALTER SYSTEM merge_action;
merge_action:
MAJOR FREEZE
| MINOR FREEZE
| {SUSPEND | RESUME} MERGE
| CLEAR MERGE ERROR
Parameters
| Parameter | Description |
|---|---|
| MAJOR FREEZE | Initiates a major compaction. Note: A user tenant can initiate a major compaction only for the current tenant. |
| MINOR FREEZE | Initiates a minor compaction. Note: A user tenant can initiate a minor compaction only for the current tenant. |
| {SUSPEND | RESUME} MERGE | Suspends or resumes a major compaction. Note: A user tenant can suspend or resume a major compaction only for the current tenant. |
| CLEAR MERGE ERROR | Removes major compaction error tags. Note: A user tenant can remove major compaction error tags only in the current tenant. |
| tenant_name | The tenant on which a minor compaction is performed. |
| TABLET_ID | The partition on which a minor compaction is performed. |
| SERVER | The server on which a minor compaction is performed. |
Examples
Major compaction in the storage layer
Initiate a major compaction for a user tenant.
obclient> ALTER SYSTEM MAJOR FREEZE; Query OK, 0 rows affectedSuspend the major compaction of a user tenant.
obclient> ALTER SYSTEM SUSPEND MERGE; Query OK, 0 rows affectedResume the major compaction of a user tenant.
obclient> ALTER SYSTEM RESUME MERGE; Query OK, 0 rows affectedRemove the major compaction error tags of a user tenant.
obclient> ALTER SYSTEM CLEAR MERGE ERROR; Query OK, 0 rows affected
Minor compaction at the storage layer
Initiate a minor compaction for a user tenant.
obclient> ALTER SYSTEM MINOR FREEZE; Query OK, 0 rows affected