Database Indexing & Transactions: B-Trees, EXPLAIN, Isolation & Deadlocks

Deep dive into B-Tree indexing, EXPLAIN ANALYZE, transaction isolation levels, deadlocks, and locking strategies.

In this article

  • Why These Two Topics Go Together
  • How B-Tree Indexes Work
  • When to Index
  • EXPLAIN ANALYZE
  • Transactions
  • Isolation Levels & Anomalies
  • Database Deadlocks
  • Optimistic vs Pessimistic Locking
  • Robotics Connection: Two Dispatchers Racing for the Same Robot
  • Worked Example: Fixing a Slow Mission History Page
  • Common Mistakes
  • Practice Questions