Prompt Details
Model
(claude-4-7-opus)
Token size
456
Example input
[DATABASE_ENGINE]: PostgreSQL 16 Enterprise Edition
[PERFORMANCE_BOTTLENECK]: Slow aggregate reports causing transaction blocking
[QUERY_CONTEXT]: SELECT * FROM transactions WHERE merchant_id = 55 AND created_at > '2025-01-01' ORDER BY created_at DESC;
[SCALING_STRATEGY]: High read-heavy analytical dashboard requiring sub-second responses
Example output
# Database Performance Engineering Report
## PHASE 1: EXECUTION PLAN & BOTTLENECK AUDIT
- Root Cause: The query is performing a sequential scan on the 'transactions' table (10M+ rows) because the 'created_at' column lacks an index.
- Contention: Heavy read-locks during report generation are causing blocking delays on write operations.
## PHASE 2: INDEXING & QUERY OPTIMIZATION
- Optimized Query: Use CTEs to pre-filter data before performing the JOIN.
- Indexing Strategy: Create a B-Tree composite index on (merchant_id, created_at) to support the filtering and sorting pattern.
## PHASE 3: SCHEMA & DATA DISTRIBUTION STRATEGY
- Strategy: Implement Table Partitioning by range (monthly) to limit the scan scope.
- Read Delegation: Route report generation to a read-replica to decouple analytical load from the primary write-node.
## PHASE 4: MONITORING & REGRESSION GUARDRAILS
- Risk 1: Index bloat slowing down concurrent writes. Mitigation: Schedule regular 'VACUUM ANALYZE' maintenance.
- Risk 2: Memory exhaustion. Mitigation: Set 'statement_timeout' for all report queries to kill runaway processes.
By purchasing this prompt, you agree to our terms of service
CLAUDE-4-7-OPUS
Stop production database bottlenecks. This prompt acts as a Senior Database Performance Architect, auditing slow execution plans, optimizing indexes, and re-architecting schema pain points. From rewriting complex JOINs to designing sharding partitions and high-load strategies, this tool helps you scale your storage layer, reduce latency, and ensure database health under concurrent traffic. Perfect for engineers needing to fix slow queries and maximize throughput.
...more
Added 3 days ago
