Prompt·Performance and scale·P03

Queries that grow badly

Finds the database queries that will be the first to slow down as tables grow.

Markdown
Prompt
Find database queries whose cost grows disproportionately with records, tenants, or relationships. Examine execution plans, indexes, joins, pagination, and application-side filtering.
What it returns
EXPLAIN ANALYZE output for each suspect query at realistic row counts, plus the index or rewrite and its new plan.
Skip it when
Tables that will stay small (settings, lookup lists).
Changes
Changes nothing
Sessions
One session
Tools
Read-only database access with EXPLAIN (the database's query plan). A Neon or Supabase branch copy for anything heavier.
Also called
Query scaling

Related prompts

More in Performance and scale.