postgres-expert · 0xfurai — субагент для Claude Code
Субагент postgres-expert помогает проектировать схемы PostgreSQL, оптимизировать медленные SQL-запросы и настраивать индексы под рабочую нагрузку.
MIT ★ 1 029 обновлён 2025-10-15
.claude/agents/postgres-expert.mdЧто делает postgres-expert
Субагент специализируется на администрировании и тюнинге PostgreSQL. Он разбирает планы выполнения запросов, подбирает индексы под баланс чтения и записи, а также помогает с партиционированием больших таблиц.
В инструкциях заложен контроль транзакций на соответствие ACID, выбор уровней изоляции и блокировок. Ответы включают разобранный SQL с CTE и оконными функциями, рекомендации по файлам конфигурации и стратегии резервного копирования вроде PITR.
В манифесте субагента прописана конкретная модель claude-sonnet-4-20250514, поэтому Claude Code запускает задачи именно на ней.
Какие задачи решает
- Оптимизировать план выполнения медленного SQL-запроса с CTE
- Спроектировать схему базы данных с нормализацией и ограничениями
- Подобрать индексы под профиль нагрузки без замедления записи
- Настроить партиционирование и стратегию восстановления PITR
Примеры запросов агенту
- Проанализируй план выполнения этого медленного запроса и предложи индексы
- Спроектируй схему для биллинга с контролем целостности данных
- Настрой параметры postgresql.conf для сервера с аналитической нагрузкой
Как установить postgres-expert
Вручную: положить файлы
.claude/agents/postgres-expert.mdДля всех проектов — ~/.claude/agents/. Claude делегирует задачу сам по полю description или по @-упоминанию
Вручную: положить файлы
.codex/agents/postgres-expert.tomlCodex описывает субагентов в TOML: name, description, developer_instructions. Текст из Markdown перенесите в developer_instructions вручную. Для всех проектов — ~/.codex/agents/
Вручную: положить файлы
.cursor/agents/postgres-expert.mdCursor понимает и .claude/agents/
По шагам, с командами для каждой платформы: Субагенты Claude Code: как создать, вызвать и не утопить контекст
Вопросы о postgres-expert
Как установить postgres-expert в Claude Code?
Сохраните файл субагента по пути .claude/agents/postgres-expert.md в корне вашего проекта.
Что делает postgres-expert?
Он анализирует планы выполнения SQL-запросов, находит узкие места, проектирует схемы данных и составляет конфигурации PostgreSQL под конкретный профиль нагрузки.
Какую модель использует субагент?
В конфигурации субагента задана модель claude-sonnet-4-20250514.
Исходный текст
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
Похожие субагенты
Все субагенты по теме «Данные и базы» →Сначала — postgres-expert от других авторов.