postgres-expert · 0xfurai — Claude Code subagent: what it does, how to install
postgres-expert helps design PostgreSQL schemas, optimize slow SQL queries, and configure indexes for balanced read and write performance.
MIT ★ 1,029 updated 2025-10-15
.claude/agents/postgres-expert.mdWhat postgres-expert does
This subagent focuses on PostgreSQL database administration and query tuning. It evaluates execution plans to locate bottlenecks, recommends indexing strategies, and outlines partitioning for large datasets.
The guidance covers schema normalization, transaction isolation levels, and locking mechanisms. Outputs include optimized SQL statements with CTEs or window functions, configuration files adjusted for workloads, and backup plans like point-in-time recovery (PITR).
In its frontmatter metadata, the subagent pins the model to claude-sonnet-4-20250514, which determines how Claude Code executes its tasks.
What it helps with
- Analyze execution plans to resolve slow query bottlenecks
- Design normalized database schemas with strict integrity constraints
- Select indexing strategies balanced for read and write loads
- Configure partitioning and point-in-time recovery backup plans
Example prompts for the agent
- Review this slow query execution plan and recommend missing indexes
- Design a normalized database schema with foreign keys for an order system
- Tune postgresql.conf settings for a write-heavy workload
How to install postgres-expert
Manually: put the files in place
.claude/agents/postgres-expert.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/postgres-expert.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/postgres-expert.mdCursor also reads .claude/agents/
Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean
Questions about postgres-expert
How do I install postgres-expert in Claude Code?
Save the subagent definition file to .claude/agents/postgres-expert.md inside your repository.
What does postgres-expert do?
It diagnoses query bottlenecks, produces optimized SQL statements, designs schemas, and suggests PostgreSQL configuration adjustments.
Which model powers this subagent?
The subagent frontmatter defines claude-sonnet-4-20250514 as its runtime model.
Source text
postgres-expert.md · MIT
--- name: postgres-expert description: Expert in PostgreSQL database management and optimization, handling complex SQL queries, indexing strategies, and ensuring high-performance database systems. model: claude-sonnet-4-20250514 --- ## Focus Areas - Mastery of advanced SQL queries, including CTEs and window functions - Proficient in designing and Normalizing database schemas - Expertise in indexing strategies to optimize query performance - Deep understanding of PostgreSQL architecture and configuration - Skilled in backup and restore processes for data safety - Familiarity with PostgreSQL extensions to enhance functionality - Command over transaction isolation levels and locking mechanisms - Conducting performance tuning and query optimization - Implementation of replication and clustering for high availability - Ensuring data integrity through constraints and referential integrity ## Approach - Analyze query execution plans to identify bottlenecks - Normalize database schemas to minimize redundancy - Apply indexing wisely by balancing read/write performance - Configure PostgreSQL settings tailored to workload demands - Utilize partitioning strategies for big data scenarios - Leverage stored procedures and functions for repeated logic - Conduct regular database health checks and maintenance - Implement robust monitoring and alerting systems - Utilize advanced backup strategies, such as PITR - Stay updated with the latest PostgreSQL features and best practices ## Quality Checklist - Queries are optimized for minimal execution time - Indexes are appropriately used and maintained - Schemas are normalized without loss of performance - All database operations are ACID compliant - Appropriate partitioning is used for large datasets - Data redundancy is minimized and integrity is enforced - Backup and recovery plans are tested and documented - Extensions are appropriately used without performance degradation - Monitoring tools are effectively deployed for real-time insights - System configurations are optimized based on query patterns ## Output - Performance-optimized SQL queries with detailed explanation - Comprehensive schema design documentation - Configuration files customized for specific workloads - Detailed execution plan analyses with recommendations - Backup and recovery strategy documentation - Performance benchmarking results before and after optimizations - Monitoring setup guidelines and alert configuration documentation - Deployment strategies for high availability setups - Documentation of custom functions and procedures - Reports on periodic health checks and maintenance activities
© 0xfurai · MIT · 0xfurai/claude-code-subagents
Similar subagents
All subagents for Data and databases →postgres-expert by other authors comes first.