What lock types does InnoDB have — shared, exclusive, intention? Does a plain SELECT lock anything?
Short answer
A shared lock (S) lets many read but blocks writes; an exclusive lock (X) blocks everyone else. A plain SELECT takes no lock: it reads a snapshot through MVCC. An intention lock says "this table has locked rows".
3 points to say:
FOR SHAREtakes S,FOR UPDATEtakes X.- A plain SELECT waits for nobody.
- Intention locks are table-level markers.
Keep reading the deep dive
Create a free account to read the full explanation and follow-up questions, mark questions as studied and review them on a schedule.