technotes · topic
First-principles depth — the clustered index, query planning, transactions, locking, durability & replication.
The table is a B+tree by primary key — so a secondary read is a double lookup, and PK choice is a storage decision.
doneA composite index is a phone book — only leftmost prefixes are searchable, so column order is a design decision.
doneGrade any plan in one pass: access type, key, rows × filtered, Extra — plus EXPLAIN ANALYZE for estimates vs reality.
doneThe four killers — wrapped columns, leading wildcards, type mismatches, low selectivity — and the fix for each.
doneA plain read is a lock-free MVCC snapshot; the isolation level just times it. RR vs RC, and the three anomalies.
doneLocks sit on index records; record/gap/next-key locks; the deadlock cycle, the victim, and how to retry.
doneWrite-ahead logging: redo rolls forward on crash, undo rolls back (and powers MVCC); the flush-at-commit dial.
doneThe binlog as a logical change feed; receiver/applier threads; async vs semisync and the failover data-loss window.
doneAll eight topics mixed on purpose — a cross-pillar quiz plus diagnose-it scenarios to convert fluency into durable memory.
doneEXPLAIN plan, a
slow query, or a fuzzy concept to your session and we'll dissect it together.