MySQL

MySQL

6 posts in this category

LOST
DIRTY
PHTM
Isolation Level
rc • rr • for update
BackendMySQLDatabase

MySQL Isolation Levels: Common Race Conditions and How to Fix Them

MySQL's default REPEATABLE READ doesn't prevent every race condition. Dirty reads, lost updates, phantom reads, write skew — which isolation level prevents which, when SELECT FOR UPDATE is the real fix, and when optimistic locking is better.

12 min read18/06/2026
TX1
LOCK
TX2
Deadlock
innodb • log • rollback
BackendMySQLDatabase

MySQL Deadlock: How to Read InnoDB Logs and Reduce Occurrence

MySQL auto-resolves deadlocks but randomly rolls back a transaction, causing errors at the app layer. How to read SHOW ENGINE INNODB STATUS to find exactly which row was locked, common causes, and 5 ways to reduce deadlock probability.

12 min read18/06/2026
12s
200ms
MySQL Query
explain • scan • optimize
DatabaseMySQLSQL

Can SQL handle large datasets? Indexes and query design in MySQL

Why SQL still works well at scale when schema, indexes, and query design are correct, from filtering before joins to MySQL patterns for millions of customers.

11 min read18/06/2026
12s
200ms
MySQL Query
explain • scan • optimize
BackendMySQLDatabase

MySQL ORDER BY + LIMIT Slow Despite Index: Filesort, Composite Index, and Cursor Pagination

ORDER BY combined with LIMIT can trigger a filesort over millions of rows even with indexes in place. How MySQL picks its execution plan, how to read EXPLAIN, and 4 practical optimization patterns.

12 min read18/06/2026
IDX
SLOW
MySQL Index
scan • query • data
DatabaseMySQLSQL

The role of indexes and the query patterns that make MySQL slow

Why indexes matter in MySQL, and common slow-query patterns such as missing indexes, selecting too much data, or filtering in application code.

10 min read16/06/2026
12s
200ms
MySQL Query
explain • scan • optimize
DatabaseMySQLSQL

Optimizing a MySQL query on 300k+ records

Case study: bringing a MySQL query from 12 seconds down to 200ms using EXPLAIN, composite indexes, and a query rewrite.

10 min read05/06/2026