tencent cloud

TDSQL Boundless

OPTIMIZE TABLE

下载
聚焦模式
字号
最后更新时间: 2026-04-03 16:45:14
本文档由 AI 翻译

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)

帮助和支持

本页内容是否解决了您的问题?

填写满意度调查问卷,共创更好文档体验。

文档反馈