How to disable index in innodb

后端 未结 4 1730
小蘑菇
小蘑菇 2020-12-05 17:03

I\'m trying to speed up bulk insert in an InnoDB table by temporary disabling its indexes:

ALTER TABLE mytable DISABLE KEYS;

But it gives

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-05 17:58

    Have you tried the following?

        SET autocommit=0; 
        SET unique_checks=0; 
        SET foreign_key_checks=0;
    

    From the MySQL References https://dev.mysql.com/doc/refman/5.5/en/optimizing-innodb-bulk-data-loading.html

    See Section "Bulk Data Loading Tips"

提交回复
热议问题