Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardSQLrow vs table lockingSingle-choice MCQ

InnoDB takes row locks on index records, not on rows in the heap. Given that, why can `UPDATE t SET x = 1 WHERE non_indexed_col = 5` end up locking far more rows than actually match, and what determines exactly which records get locked?

UPDATE t SET x = 1 WHERE non_indexed_col = 5;