postgresql-optimization
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePostgreSQL Optimization Workflow
PostgreSQL数据库优化工作流
Overview
概述
Specialized workflow for PostgreSQL database optimization including query tuning, indexing strategies, performance analysis, vacuum management, and production database administration.
专为PostgreSQL数据库优化设计的工作流,涵盖查询调优、索引策略、性能分析、VACUUM管理以及生产数据库运维。
When to Use This Workflow
何时使用此工作流
Use this workflow when:
- Optimizing slow PostgreSQL queries
- Designing indexing strategies
- Analyzing database performance
- Tuning PostgreSQL configuration
- Managing production databases
在以下场景使用此工作流:
- 优化缓慢的PostgreSQL查询
- 设计索引策略
- 分析数据库性能
- 调优PostgreSQL配置
- 管理生产数据库
Workflow Phases
工作流阶段
Phase 1: Performance Assessment
阶段1:性能评估
Skills to Invoke
需调用的技能
- - Database optimization
database-optimizer - - PostgreSQL best practices
postgres-best-practices
- - 数据库优化
database-optimizer - - PostgreSQL最佳实践
postgres-best-practices
Actions
操作步骤
- Check database version
- Review configuration
- Analyze slow queries
- Check resource usage
- Identify bottlenecks
- 检查数据库版本
- 查看配置信息
- 分析慢查询
- 检查资源使用情况
- 识别性能瓶颈
Copy-Paste Prompts
可复制粘贴的提示词
Use @database-optimizer to assess PostgreSQL performanceUse @database-optimizer to assess PostgreSQL performancePhase 2: Query Analysis
阶段2:查询分析
Skills to Invoke
需调用的技能
- - SQL optimization
sql-optimization-patterns - - PostgreSQL patterns
postgres-best-practices
- - SQL优化
sql-optimization-patterns - - PostgreSQL模式
postgres-best-practices
Actions
操作步骤
- Run EXPLAIN ANALYZE
- Identify scan types
- Check join strategies
- Analyze execution time
- Find optimization opportunities
- 运行EXPLAIN ANALYZE
- 识别扫描类型
- 检查连接策略
- 分析执行时间
- 寻找优化机会
Copy-Paste Prompts
可复制粘贴的提示词
Use @sql-optimization-patterns to analyze and optimize queriesUse @sql-optimization-patterns to analyze and optimize queriesPhase 3: Indexing Strategy
阶段3:索引策略
Skills to Invoke
需调用的技能
- - Index design
database-design - - PostgreSQL indexing
postgresql
- - 索引设计
database-design - - PostgreSQL索引
postgresql
Actions
操作步骤
- Identify missing indexes
- Create B-tree indexes
- Add composite indexes
- Consider partial indexes
- Review index usage
- 识别缺失的索引
- 创建B-tree索引
- 添加复合索引
- 考虑部分索引
- 检查索引使用情况
Copy-Paste Prompts
可复制粘贴的提示词
Use @database-design to design PostgreSQL indexing strategyUse @database-design to design PostgreSQL indexing strategyPhase 4: Query Optimization
阶段4:查询优化
Skills to Invoke
需调用的技能
- - Query tuning
sql-optimization-patterns - - SQL expertise
sql-pro
- - 查询调优
sql-optimization-patterns - - SQL专业技能
sql-pro
Actions
操作步骤
- Rewrite inefficient queries
- Optimize joins
- Add CTEs where helpful
- Implement pagination
- Test improvements
- 重写低效查询
- 优化连接操作
- 在合适的场景添加CTE
- 实现分页
- 测试优化效果
Copy-Paste Prompts
可复制粘贴的提示词
Use @sql-optimization-patterns to optimize SQL queriesUse @sql-optimization-patterns to optimize SQL queriesPhase 5: Configuration Tuning
阶段5:配置调优
Skills to Invoke
需调用的技能
- - Configuration
postgres-best-practices - - Database administration
database-admin
- - 配置调优
postgres-best-practices - - 数据库运维
database-admin
Actions
操作步骤
- Tune shared_buffers
- Configure work_mem
- Set effective_cache_size
- Adjust checkpoint settings
- Configure autovacuum
- 调优shared_buffers
- 配置work_mem
- 设置effective_cache_size
- 调整检查点设置
- 配置autovacuum
Copy-Paste Prompts
可复制粘贴的提示词
Use @postgres-best-practices to tune PostgreSQL configurationUse @postgres-best-practices to tune PostgreSQL configurationPhase 6: Maintenance
阶段6:维护
Skills to Invoke
需调用的技能
- - Database maintenance
database-admin - - PostgreSQL maintenance
postgresql
- - 数据库维护
database-admin - - PostgreSQL维护
postgresql
Actions
操作步骤
- Schedule VACUUM
- Run ANALYZE
- Check table bloat
- Monitor autovacuum
- Review statistics
- 安排VACUUM任务
- 运行ANALYZE
- 检查表膨胀情况
- 监控autovacuum
- 查看统计信息
Copy-Paste Prompts
可复制粘贴的提示词
Use @database-admin to schedule PostgreSQL maintenanceUse @database-admin to schedule PostgreSQL maintenancePhase 7: Monitoring
阶段7:监控
Skills to Invoke
需调用的技能
- - Monitoring dashboards
grafana-dashboards - - Metrics collection
prometheus-configuration
- - 监控仪表盘
grafana-dashboards - - 指标收集
prometheus-configuration
Actions
操作步骤
- Set up monitoring
- Create dashboards
- Configure alerts
- Track key metrics
- Review trends
- 搭建监控系统
- 创建仪表盘
- 配置告警
- 跟踪关键指标
- 查看趋势变化
Copy-Paste Prompts
可复制粘贴的提示词
Use @grafana-dashboards to create PostgreSQL monitoringUse @grafana-dashboards to create PostgreSQL monitoringOptimization Checklist
优化检查清单
- Slow queries identified
- Indexes optimized
- Configuration tuned
- Maintenance scheduled
- Monitoring active
- Performance improved
- 已识别慢查询
- 已优化索引
- 已调优配置
- 已安排维护任务
- 已启用监控
- 性能已提升
Quality Gates
质量门控
- Query performance improved
- Indexes effective
- Configuration optimized
- Maintenance automated
- Monitoring in place
- 查询性能已提升
- 索引有效
- 配置已优化
- 维护已自动化
- 监控已部署
Related Workflow Bundles
相关工作流包
- - Database operations
database - - Infrastructure
cloud-devops - - Performance
performance-optimization
- - 数据库操作
database - - 基础设施
cloud-devops - - 性能优化
performance-optimization