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.

Markdown
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

More in Performance and maintenance.