Prompt·Performance and maintenance·PG14
What will become expensive as the database grows?
Fact or history tables are growing fast, or you need to plan capacity.
Prompt
Use actual table sizes, row growth, query plans and workload patterns to identify the first database operations likely to become disproportionately expensive as data grows. Evaluate indexing, partitioning, pagination, aggregation and retention only where the evidence justifies them. Show what scale would trigger a change rather than optimizing everything prematurely.
- What it returns
- Current row counts and growth rates, the workload assumed, the size at which each operation becomes a bottleneck, and costs before and after at a realistic scale.
- Skip it when
- Data volume is small and flat.
- Avoid
- Partitioning or new layers without a measured or credible need.
- Changes
- Changes nothing
- Sessions
- Look first, then fix in a new session
- Tools
- Needs: read-only database access. Helps: query statistics (pg_stat_statements) and HypoPG.
- Works on
- Any PostgreSQL host: Supabase, Neon, RDS, Cloud SQL or self-hosted.
Related prompts
- Queries that grow badlyPromptFinds the database queries that will be the first to slow down as tables grow.
- What breaks at ten times the sizePromptNames the first thing to break if the project takes off, before it does.
- 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 maintenance.