What lock will cause mysql to "load data infile" on innodb?

I use LOAD DATA INFILEInnoDB in the table, and I see the "System Lock" status in SHOW PROCESSLIST. Which lock blocks InnoDB in this situation? How can I check what is blocked?

+3
source share
1 answer

There are two parts to your question: what LOAD DATA INFILEreally blocks in InnoDB and how you can investigate locks.

A command LOAD DATA INFILEis basically a slightly more efficient way to do multi-line INSERT, and it will block the same thing as INSERT. As it is processed, LOAD DATA INFILEfor each index in the loaded table, the key from the loaded row is locked with exclusive row locking.

While it is running LOAD DATA INFILE, you can see some general statistics about its blocking with SHOW ENGINE INNODB STATUS. If you turn on the InnoDB lock monitor , you can see more detailed information about each individual locked capture (to the point).

+6
source

All Articles