Skip to content

Blog: notes on backend, data and AI

Notes on backend engineering, data and building products with AI.

70 posts · page 1 of 7

RSS feed

November 25, 2026 · 4 min read

Pagination in MySQL: OFFSET, keyset and deferred join

LIMIT with a large OFFSET gets slower with every page because MySQL reads and discards the skipped rows. Keyset pagination and the deferred join keep deep pages fast.

mysqlpaginationperformance

November 25, 2026 · 4 min read

Why MySQL is not using your index

You added an index and the query is still slow. The usual causes are functions on the column, type mismatches, leading wildcards, mixed collations and an optimizer that judged a scan cheaper.

mysqlindexingperformance

November 25, 2026 · 4 min read

Reading EXPLAIN and EXPLAIN ANALYZE in MySQL

EXPLAIN shows how MySQL plans to run a query, and EXPLAIN ANALYZE shows what really happened. Learn the columns that matter and a repeatable method for tuning a slow query.

mysqlperformancesql

November 25, 2026 · 4 min read

Composite indexes and the leftmost prefix rule

A composite index is sorted by its first column, then the second, and so on. That order decides which queries it can seek, which it can sort, and which it cannot help at all.

mysqlindexingperformance

November 25, 2026 · 4 min read

InnoDB indexes: B+Tree, clustered, secondary and covering

Every InnoDB table is a B+Tree ordered by its primary key. Understand clustered and secondary indexes, the extra lookup they cause, and how covering indexes remove it.

mysqlinnodbindexing

November 25, 2026 · 4 min read

Deadlocks in MySQL: find them, prevent them, retry them

A deadlock is two transactions waiting for each other. InnoDB breaks it by rolling one back, so your code must retry. Here is how to read the report and design the cause away.

mysqlinnodblocking

November 25, 2026 · 4 min read

InnoDB locks: record, gap and next-key locks

InnoDB locks index entries, not abstract rows. Learn what record, gap, next-key and intention locks protect, and why a query without a usable index can lock far more than you expect.

mysqlinnodblocking

November 25, 2026 · 4 min read

MVCC in InnoDB: snapshot reads versus current reads

InnoDB keeps several versions of a row so readers do not block writers. The catch is that a plain SELECT and a locking read can see different data.

mysqlinnodbtransactions

November 25, 2026 · 4 min read

Isolation levels and anomalies in MySQL

Dirty reads, non-repeatable reads, phantoms and lost updates are what isolation levels are about. See what each level allows and what InnoDB does by default.

mysqlinnodbtransactions

November 25, 2026 · 4 min read

ACID in InnoDB: WAL, redo log, undo log and the binlog

ACID is not magic. In InnoDB, atomicity comes from the undo log, durability from the redo log, and the binlog is a separate log for replication and CDC.

mysqlinnodbtransactions

Have a project in mind?

Tell me what you are building. I reply by email, usually within two working days.

Start a conversation