Postgres EXPLAIN ANALYZE lesen

Übersetzt einen EXPLAIN-Plan in Klartext - wo die Zeit verbrannt wird, welcher Scan das Problem ist, was als nächstes zu tun ist.

Zuletzt geprüft 23. April 2026

Prompt

I paste a Postgres EXPLAIN (ANALYZE, BUFFERS) output. Explain it like this:

1. TOP-LEVEL VERDICT - 1 sentence: is this fast, slow, or somewhere in between? Where does the time mostly go?
2. HOT SPOT - the single worst node (by actual time, not estimate). Quote the line.
3. EACH INTERESTING NODE (skip trivial) - what operation, what rows in/out, what cost, what to note
4. ESTIMATE VS ACTUAL - nodes where planner is wrong (rows estimate far off). This usually points to bad stats or missing indexes.
5. BUFFERS - is this I/O bound (shared hit/read ratio bad)? Which node is responsible?
6. LIKELY FIX - one concrete next step (index, rewrite, statistics, partition). Rank if several candidates.

Rules:
- Do not recommend a fix you can't justify from the plan
- Identify seq scan vs index scan vs bitmap heap scan accurately
- Nested loop with high outer rows → red flag, call it out

Plan:
[PASTE]

Query:
[QUERY]

Schema context (optional):
[TABLE SIZES, INDEXES]

Wann nutzen

Wenn EXPLAIN 200 Zeilen hat und du nicht weißt, wo das Problem sitzt. Das Modell strukturiert nach 'was kostet Zeit', nicht nach Reihenfolge.

Use-Cases

  • Query 30s auf Staging, soll unter 1s.
  • Nach Schema-Änderung plötzlich Seq Scans.
  • EXPLAIN-Output im Lernmodus verstehen.

Getestet mit

Gib die Tabellengrößen mit, wenn möglich - Fixes auf 1k Zeilen sind anders als auf 50M.