Data & Performance

SQL Performance Is About the Execution Plan, Not the Query

Recently, I went deep on SQL performance while investigating database load in Postgres, and it changed how I debug DB issues.

The shift wasn't writing "clever" SQL. It was learning how the database actually executes queries.

I used to tweak queries and hope for improvement. Now, when I see elevated DB load or timeouts, I start by asking why the database is doing the work it's doing.

A few things that changed my approach

If you're not reading the plan, you're mostly guessing.

Treating performance issues as system behavior — rather than trial-and-error — has made debugging more predictable.