本文介绍了如何检查启用/禁用键是否有效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有索引 varchar(256)列的表。

I have a table with an indexed varchar(256) column.

为了加快批量插入,我禁用密钥,插入超过1000万个条目,然后在插入完成后重新启用密钥。

For faster bulk insert, I disabled keys, insert more than 10 million entries, and then re-enable the keys after insertion is done.

令人惊讶的是,启用/禁用键没时间

Surprisingly, the enable/disable keys took no time:


mysql> alter table xxx disable keys;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> alter table xxx enable keys;
Query OK, 0 rows affected, 1 warning (0.00 sec)

如何确保启用/禁用密钥正常工作正确吗?

How do I ensure that enable/disable keys were working properly?

推荐答案

正如您所猜测的,InnoDB不支持DISABLE / ENABLE KEYS。您收到的警告是:

As you guessed, InnoDB does not support DISABLE/ENABLE KEYS. The warning you got is:

正如你可以看到。
要自己查看警告,请在运行 ALTER 后运行 SHOW WARNINGS;

As you can see here.To see the warning yourself, run SHOW WARNINGS; after you run the ALTER.

这篇关于如何检查启用/禁用键是否有效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 11:59