# Queries that grow badly

Prompt · Performance and scale · P03

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

## Prompt

```text
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).

**Tools:** Read-only database access with EXPLAIN (the database's query plan). A Neon or Supabase branch copy for anything heavier.

**Changes:** Changes nothing

**Sessions:** One session

## Related

- [Slowest journeys, end to end](https://www.atlasscope.dev/prompts/slowest-journeys-end-to-end): Shows where the seconds go on the paths people actually use.
- [What breaks at ten times the size](https://www.atlasscope.dev/prompts/what-breaks-at-ten-times-the-size): Names the first thing to break if the project takes off, before it does.
- [Loops that blow up with big data](https://www.atlasscope.dev/prompts/loops-that-blow-up-with-big-data): Finds loops inside loops that are fine at 50 rows and painful at 50,000.
- [Find the true sources of database waste](https://www.atlasscope.dev/prompts/find-the-true-sources-of-database-waste): The bill is high, CPU or disk usage is high, storage keeps growing, or you suspect bloat.

Source: https://www.atlasscope.dev/prompts/queries-that-grow-badly
