tencent cloud

TDSQL Boundless

OPTIMIZE TABLE

PDF
フォーカスモード
フォントサイズ
最終更新日: 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)

ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック