Purpose
You can use this statement to initiate a major or minor compaction in the storage layer for a user tenant from the current tenant. You can initiate a major or minor compaction at the tenant or partition level.
Syntax
ALTER SYSTEM merge_action;
merge_action:
MAJOR FREEZE [TABLET_ID = tablet_id]
| MINOR FREEZE [TABLET_ID = tablet_id]
| {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. |
| TABLET_ID | The partition 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 affectedInitiate a major compaction at the partition level for a user tenant.
obclient> ALTER SYSTEM MAJOR FREEZE TABLET_ID = 5; 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 in the storage layer
Initiate a minor compaction for a user tenant.
obclient> ALTER SYSTEM MINOR FREEZE; Query OK, 0 rows affectedInitiate a minor compaction at the partition level for a user tenant.
obclient> ALTER SYSTEM MINOR FREEZE TABLET_ID = 5; Query OK, 0 rows affected