flashman
← All posts

Format messy SQL during incident response

Beautify ORM-generated queries from logs so on-call can read them under pressure.

2026-06-08 · 4 min read · Rahul Chitturi

  • sql
  • on-call

ORM logs ship single-line SQL that is nearly impossible to read at 2 a.m. A formatter breaks JOINs and WHERE clauses onto separate lines so you can spot missing filters or cartesian products.

Incident tip

Copy the slow query log entry, format it, and annotate which table is missing an index. Paste the formatted version into the incident doc for the postmortem.

Try these tools