My mysql version is 8.0. I have an InnoDB table with more than 10 million rows of data, and the data file size is 2G.
I am using pd.to_sql to insert several thousand rows of data each time. When the index is enabled, the insertion speed is very slow.
How to temporarily disable the index? And after the insertion is complete, enable the index?
I tried the operation in How to disable index in innodb:
SET autocommit=0;
SET unique_checks=0;
SET foreign_key_checks=0;
But the index is still valid.