Interview Q&A · questions with model answers
MySQL Interview Questions
Part of the study plan for: Data Engineer
Ordered by how often they're asked. Most-asked answers are free to read in full; members see every answer and can rate their confidence on each.
-
Most asked Why might MySQL not use an index you created?
Common causes: a function or expression on the column (WHERE DATE(created_at) = ...), implicit type conversion (comparing a VARCHAR column to a number), a leading wildcard (LIKE '%abc'), not using…
-
Most asked Why is OFFSET pagination slow on large tables, and what is keyset pagination?
LIMIT 20 OFFSET 100000 makes MySQL read and discard 100,000 rows before returning 20, so deep pages get linearly slower. Keyset (seek) pagination remembers the last row's sort key and asks for WHERE…
-
Why is SELECT COUNT(*) slow on a big InnoDB table?
InnoDB has no stored row count, because with MVCC different transactions can see different numbers of rows. COUNT(*) must scan an index (MySQL picks the smallest secondary index) to count rows…