Code Room
On-callHardoc-g229
Subject Index corruptionLevel Senior–Staff~40 minCommon in Databases & SQL interviewsIndustries Technology, Software development

Question

Postgres 13. A query that filters on `email` started returning *no rows* for users that definitely exist (an index-only lookup), while a seq-scan of the same table finds them. This began after the host had an unclean shutdown last week from a kernel panic; the DB came back up and ran fine until now. `amcheck`'s `bt_index_check` on the `email` btree throws errors. The cluster is a primary with one streaming replica. Triage, restore correctness now, and figure out blast radius.

What a strong answer looks like

Stop the bleeding first (mitigate), then form hypotheses from real signals. Separate root cause from symptom, communicate status as you go, and close with what prevents a repeat.

Diagram & narrate the incident
Loading whiteboard…
Run or narrate your approach, then ask the coach.