Team Wrote Query Runbook After Finding No Production Query Statistics, Then Found Its Own References Outdated
A developer team running CogniPrep on Postgres via Supabase kept a hand-written SQL runbook alongside its migrations. The runbook was created because the team lacked production query statistics, so earlier index changes rested on code reading rather than measurement. Migration 0036 dropped eight indexes on that basis, and its own comments admitted the claims were unverified. A companion file, observability.sql, uses pg_stat_statements to gather evidence, and its only non-read-only step is an idempotent extension creation. The article highlights how the queries rank by total time and detect wasteful row-heavy queries, while noting that the database remains small for now.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in