Prompt·Performance and scale·P03
Queries that grow badly
Finds the database queries that will be the first to slow down as tables grow.
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
- Slowest journeys, end to endPromptShows where the seconds go on the paths people actually use.
- What breaks at ten times the sizePromptNames the first thing to break if the project takes off, before it does.
- Loops that blow up with big dataPromptFinds loops inside loops that are fine at 50 rows and painful at 50,000.
- Find the true sources of database wastePromptThe bill is high, CPU or disk usage is high, storage keeps growing, or you suspect bloat.
More in Performance and scale.