tencent cloud

TDSQL Boundless

OPTIMIZE TABLE

Download
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-04-03 16:45:14

Description

This statement performs compaction on the data range of the specified table. Its execution does not lock the table or block read and write requests.

Permission Requirements

SELECT and INSERT privileges.

Syntax

OPTIMIZE [NO_WRITE_TO_BINLOG | LOCAL]
TABLE tbl_name [, tbl_name] ...

Parameter Description

Parameter
Required
Description
NO_WRITE_TO_BINLOG
Optional
Reserved keywords have no practical feature.
LOCAL
Optional
Reserved keywords have no practical feature.

Examples

tdsql> optimize table t1;
+---------+----------+----------+----------+
| Table | Op | Msg_type | Msg_text |
+---------+----------+----------+----------+
| test.t1 | optimize | status | OK |
+---------+----------+----------+----------+
1 row in set (0.01 sec)

도움말 및 지원

문제 해결에 도움이 되었나요?

피드백