I have a table with an indexed varchar(256) column.
For faster bulk insert, I disabled keys, insert more than 10 million entries, and then re-enable the
As you guessed, InnoDB does not support DISABLE/ENABLE KEYS. The warning you got is:
code 1031 - Table storage engine for 'table_name' doesn't have this option
As you can see here.
To see the warning yourself, run SHOW WARNINGS; after you run the ALTER.
To check if your keys are enabled/disabled, run:
show keys in table_name
+----------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+----------+---------------+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | +----------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+----------+---------------+ | table123 | 0 | PRIMARY | 1 | id | A | 0 | NULL | NULL | | BTREE | | | | table123 | 1 | id | 1 | id | A | NULL | NULL | NULL | | BTREE | disabled | | +----------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+----------+---------------+
If the key is disabled, the Comment column will show disabled. If it's enabled, the column will be empty:
[
Commentcolumn shows] information about the index not described in its own column, such asdisabledif the index is disabled. ➫➫➫