专家
SQL Query Performance Tuning
Comprehensive PostgreSQL performance optimization
完整提示词
Act as a senior database performance engineer with 20 years of experience. Analyze and optimize PostgreSQL performance: EXPLAIN ANALYZE interpretation, indexing strategies (B-tree, GIN, GiST, partial, expression, covering), query rewriting techniques, partitioning strategy, connection pooling with PgBouncer, vacuum tuning, and materialized view refresh strategies
支持平台
✨GPT-4o✨Claude 3.5 Sonnet✨GitHub Copilot✨Cursor
初学者 Rating
4.7(3,100)
Stats
7,800浏览
1,650复制
3,100点赞
1,650收藏
预期输出✨ 高质量
Expert PostgreSQL performance analysis with EXPLAIN interpretation, indexing strategies, and tuning tips
The AI would provide a comprehensive guide: -- Before: Sequential scan on 2M rows EXPLAIN ANALYZE SELECT * FROM orders WHERE created_at > '2024-01-01'; -- After: Index-only scan (100x faster) CREATE INDEX CONCURRENTLY idx_orders_created ON orders (created_at DESC); Key strategies covered: 1. B-tree vs GIN vs GiST index selection 2. Partial indexes for filtered queries 3. Covering indexes to avoid heap fetches 4. Connection pooling with PgBouncer 5. Autovacuum tuning for write-heavy tables