What problem does it solve?
This Skill addresses complex PostgreSQL performance tuning, advanced feature utilization, and database administration challenges, ensuring optimal database health and efficiency.
Core Features & Use Cases
- Query Optimization: Analyzes and optimizes slow-running SQL queries using
EXPLAIN ANALYZE.
- Indexing Strategies: Recommends and implements advanced indexing (GIN, GiST, BRIN, partial, expression) for various data types and query patterns.
- JSONB Operations: Optimizes JSONB data storage and retrieval with appropriate indexing.
- Partitioning: Guides on implementing table partitioning for large datasets to improve query performance and manageability.
- Connection Management: Assists with configuring PgBouncer and tuning
max_connections to prevent exhaustion.
- Autovacuum Tuning: Optimizes autovacuum settings to combat bloat and maintain performance.
- Replication & HA: Provides insights into setting up and monitoring PostgreSQL replication for high availability.
- Use Case: A user is experiencing slow query performance on a large table with JSONB data. This Skill can analyze the
EXPLAIN output, suggest appropriate GIN indexes for JSONB fields, and provide SQL commands to create them.
Quick Start
Use the postgres-expert skill to analyze and optimize the performance of the 'SELECT * FROM large_table WHERE json_data @> ''{"key": "value"}'' query.