Tag

INSERT SELECT

0 views collected around this technical thread.

Aikesheng Open Source Community
Aikesheng Open Source Community
Jun 8, 2021 · Databases

Understanding Table Locks in MySQL When Using INSERT INTO SELECT and the Impact of Isolation Levels

The article explains why an INSERT INTO SELECT statement can lock an entire InnoDB table in MySQL, demonstrates the lock behavior with transaction examples, and offers two solutions—adding an index on the filtered column and adjusting the transaction isolation level—to avoid table‑wide blocking.

INSERT SELECTIndexInnoDB
0 likes · 13 min read
Understanding Table Locks in MySQL When Using INSERT INTO SELECT and the Impact of Isolation Levels