October 19, 2026 · QueryKings
The buffer pool is not the whole memory budget. Here is how to account for per-connection buffers, internal temporary tables, and the performance schema, how to read what the server is actually using, and how to size an instance so the kernel never has to choose a victim.
Read moreOctober 12, 2026 · QueryKings
Teams keep their job queue and transactional outbox in MySQL because it keeps the work and the write in one transaction. Here is how SELECT ... FOR UPDATE SKIP LOCKED actually behaves under InnoDB, the index and polling design that keeps it cheap, and the three failure modes it leaves on the table.
Read moreSeptember 28, 2026 · QueryKings
OFFSET pagination reads and throws away every row it skips, so page 1 is fast and page 10,000 times out. Here is the mechanism, how to see it in EXPLAIN ANALYZE, the keyset (seek) rewrite, and what to do when the product team insists on jump-to-page 4,812.
Read moreSeptember 21, 2026 · QueryKings
The index exists, EXPLAIN ignores it, and the query takes four seconds. Here is how InnoDB's cardinality estimates go stale, what histograms fix and what they do not, and the order to try ANALYZE TABLE, optimizer hints, and FORCE INDEX before you rewrite the query.
Read moreSeptember 21, 2026
Random UUID primary keys fight the clustered index: inserts land everywhere, pages split, secondary indexes carry a 36-byte key. Here is how to measure the damage, why UUIDv7 and UUID_TO_BIN(uuid, 1) fix most of it, and what migrating an existing table actually costs.
Read moreSeptember 18, 2026
Before you tune a query you have to pick the right one. How to rank a live workload with performance_schema statement digests, when the slow query log is still the better tool, and why total time beats worst-case latency as a target.
Read moreSeptember 17, 2026 · QueryKings
A 900 GB InnoDB table is not automatically a problem, and partitioning is not automatically the fix. How to tell which of the four real constraints you have hit — buffer pool, DDL time, delete cost, or a single-writer ceiling — and what each one actually calls for.
Read moreSeptember 16, 2026 · QueryKings
One idle transaction left open can slow every read on the server, grow the undo tablespace, and make a routine query plan degrade overnight. Here is how MVCC purge lag builds, how to measure it, and how to keep it from happening again.
Read moreSeptember 14, 2026
A join predicate with two different collations silently stops using the index. Here is how utf8mb3, utf8mb4_general_ci and utf8mb4_0900_ai_ci end up mixed in one schema, how to find every mismatch before it costs you a table scan, and how to migrate large tables without a maintenance window.
Read moreSeptember 14, 2026
ERROR 1040 is rarely a max_connections problem. How to find the limit that is really binding — memory per connection, thread scheduling, or a slow query holding the pool — and where a pooler like ProxySQL or RDS Proxy helps and where it hides the fault.
Read moreSeptember 11, 2026
Lock wait timeouts and deadlocks are not random. Here is how to read SHOW ENGINE INNODB STATUS and the Performance Schema lock tables, what gap locks and next-key locks actually do under REPEATABLE READ, and the four fixes that hold.
Read moreMay 19, 2026
Seven rules we apply on schema audits: design for the query shape, respect the leftmost prefix and the clustered index, make hot queries covering, and prune with invisible indexes before dropping.
Read moreApril 14, 2026
How we actually read a query plan in a tuning engagement: the columns that carry signal, the traps in Extra, join-order reasoning, and a worked example that took p99 from 1.8s to 4ms.
Read more