【MySQL】OPTIMIZE TABLE 的碎片整理功能

在这里插入图片描述

1.概述

OPTIMIZE TABLE 的碎片整理功能。

(1)创建测试表 t,字段 id 和 context 的类型分别为 varchar(100)和 text:

mysql> create table t (id varchar(100),context text);
Query OK, 0 rows affected (0.01 sec)

(2)往 t 中插入大量记录,这里使用 repeat 函数插入大字符串:

mysql> insert into t values(1,repea

猜你喜欢

转载自blog.csdn.net/qq_21383435/article/details/107548828