#SQL

12 posts
Development

Eleven Seconds to Eighty Milliseconds: Reading MySQL EXPLAIN Like a Pro

It's 2 a.m. and your phone is buzzing. The order dashboard, which loaded in 80 milliseconds last spring, now takes eleven seconds. Nothing in the code changed. What changed is the table: it went from...

2026.10.23 · 17 min read · views 466
Eleven Seconds to Eighty Milliseconds: Reading MySQL EXPLAIN Like a Pro
Development

One Line After OVER() Replaces Your Messy Self-Join

Your manager sends a one-line request on a Thursday afternoon: "Can you pull the top three orders for every customer, plus how each one compares to the previous order?" You open your SQL editor, stare...

2026.10.08 · 6 min read · views 754
One Line After OVER() Replaces Your Messy Self-Join
Development

Your Dashboard Took Eleven Seconds to Load. An Index Could Fix That.

It's a Tuesday afternoon, and the dashboard that loaded instantly during your first month of launch now takes eleven seconds. Nothing in the code changed. The table just grew from 5,000 rows to 4 mill...

2026.10.04 · 8 min read · views 854
Your Dashboard Took Eleven Seconds to Load. An Index Could Fix That.
Development

The Query That Made Me Stop Writing Self-Joins

The query was four hundred lines long. It had three nested subqueries, two of which selected from the same table with slightly different date filters, and a self-join that existed purely so one row co...

2026.09.16 · 13 min read · views 749
The Query That Made Me Stop Writing Self-Joins
Development

The Meeting Was at 9. The Server Said It Was Midnight.

A reminder fires at 4:00 in the morning. Nobody set it for 4:00 in the morning. The support ticket says the alert was scheduled for 1:00 PM. You check the database and the row says `2026-03-14 04:00:0...

2026.09.14 · 25 min read · views 1,106
The Meeting Was at 9. The Server Said It Was Midnight.
Development

The Query Was Fine at 10,000 Rows

You wrote the query in an afternoon. It ran against your development database in four milliseconds, the test suite went green, and you shipped it. Six weeks later, someone in support forwards a screen...

2026.09.01 · 21 min read · views 1,686
The Query Was Fine at 10,000 Rows
AD
Development

The Query Was Fine Until the Table Hit a Million Rows

Your app was fast for a year. Nothing changed — same code, same server, same query you wrote in an afternoon and never thought about again. Then one Tuesday the orders page takes eleven seconds to loa...

2026.08.22 · 18 min read · views 1,457
The Query Was Fine Until the Table Hit a Million Rows
Development

The JOIN That Quietly Dropped Half Your Data

You wrote a query to list your customers and their orders. It ran fine — but half your customers vanished from the results. The ones who never placed an order simply weren't there. Nothing errored, no...

2026.08.12 · 15 min read · views 2,283
The JOIN That Quietly Dropped Half Your Data
Development

Every SQL JOIN, Explained by One Simple Question

You wrote a query. It ran. And then it returned 40,000 rows when your `customers` table only has 8,000. Or worse: it returned nothing at all, even though you can see the matching records right there i...

2026.08.04 · 17 min read · views 3,067
Every SQL JOIN, Explained by One Simple Question
Development

SQL JOINs Explained: The Two Questions That Settle All Four Types

You've written a query that pulls every customer in your database. It runs fine. Then someone asks a simple-sounding question: which customers placed an order last month, and what did they spend? Sudd...

2026.07.25 · 19 min read · views 2,191
SQL JOINs Explained: The Two Questions That Settle All Four Types
AD