postgres-pro

Solid

Use when optimizing PostgreSQL queries, configuring replication, or implementing advanced database features. Invoke for EXPLAIN analysis, JSONB operations, extension usage, VACUUM tuning, performance monitoring.

API & Backend 9,509 stars 807 forks Updated 1 weeks ago MIT

Install

View on GitHub

Quality Score: 94/100

Stars 20%
100
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# PostgreSQL Pro Senior PostgreSQL expert with deep expertise in database administration, performance optimization, and advanced PostgreSQL features. ## When to Use This Skill - Analyzing and optimizing slow queries with EXPLAIN - Implementing JSONB storage and indexing strategies - Setting up streaming or logical replication - Configuring and using PostgreSQL extensions - Tuning VACUUM, ANALYZE, and autovacuum - Monitoring database health with pg_stat views - Designing indexes for optimal performance ## Core Workflow 1. **Analyze performance** — Run `EXPLAIN (ANALYZE, BUFFERS)` to identify bottlenecks 2. **Design indexes** — Choose B-tree, GIN, GiST, or BRIN based on workload; verify with `EXPLAIN` before deploying 3. **Optimize queries** — Rewrite inefficient queries, run `ANALYZE` to refresh statistics 4. **Setup replication** — Streaming or logical based on requirements; monitor lag continuously 5. **Monitor and maintain** — Track VACUUM, bloat, and autovacuum via `pg_stat` views; verify improvements after each change ### End-to-End Example: Slow Query → Fix → Verification ```sql -- Step 1: Identify slow queries SELECT query, mean_exec_time, calls FROM pg_stat_statements ORDER BY mean_exec_time DESC LIMIT 10; -- Step 2: Analyze a specific slow query EXPLAIN (ANALYZE, BUFFERS, FORMAT TEXT) SELECT * FROM orders WHERE customer_id = 42 AND status = 'pending'; -- Look for: Seq Scan (bad on large tables), high Buffers hit, nested loops on large sets -- Step 3: Create a...

Details

Author
Jeffallan
Repository
Jeffallan/claude-skills
Created
7 months ago
Last Updated
1 weeks ago
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Listed

postgres-pro

Use when optimizing PostgreSQL queries, configuring replication, or implementing advanced database features. Invoke for EXPLAIN analysis, JSONB operations, extension usage, VACUUM tuning, performance monitoring.

1 Updated today
zacklecon
API & Backend Solid

db-performance

PostgreSQL query performance — EXPLAIN ANALYZE, index design, pg_stat_statements, slow query detection, connection pool tuning.

14 Updated 3 days ago
sawrus
API & Backend Solid

postgresql

PostgreSQL query optimization, indexing, full-text search, JSONB, and advanced features.

1,034 Updated today
a5c-ai
API & Backend Solid

sql-pro

Optimizes SQL queries, designs database schemas, and troubleshoots performance issues. Use when a user asks why their query is slow, needs help writing complex joins or aggregations, mentions database performance issues, or wants to design or migrate a schema. Invoke for complex queries, window functions, CTEs, indexing strategies, query plan analysis, covering index creation, recursive queries, EXPLAIN/ANALYZE interpretation, before/after query benchmarking, or migrating queries between database dialects (PostgreSQL, MySQL, SQL Server, Oracle).

9,509 Updated 1 weeks ago
Jeffallan
API & Backend Listed

optimizing-sql

Optimize SQL query performance through EXPLAIN analysis, indexing strategies, and query rewriting for PostgreSQL, MySQL, and SQL Server. Use when debugging slow queries, analyzing execution plans, or improving database performance.

368 Updated 5 months ago
ancoleman