[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-ed9b6a8a-423d-4959-8660-999a7d012d38":3,"$fO71EeVN5yBHLhZZBVdAV1NpJpq-N8p1NsDk-0j4FEfA":42},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":33},"ed9b6a8a-423d-4959-8660-999a7d012d38","postgresql-optimization","PostgreSQL数据库优化工作流程，包括查询调优、索引策略、性能分析和生产数据库管理。","cat_coding_backend","mod_coding","sickn33,coding","---\nname: postgresql-optimization\ndescription: \"PostgreSQL database optimization workflow for query tuning, indexing strategies, performance analysis, and production database management.\"\ncategory: granular-workflow-bundle\nrisk: safe\nsource: personal\ndate_added: \"2026-02-27\"\n---\n\n# PostgreSQL Optimization Workflow\n\n## Overview\n\nSpecialized workflow for PostgreSQL database optimization including query tuning, indexing strategies, performance analysis, vacuum management, and production database administration.\n\n## When to Use This Workflow\n\nUse this workflow when:\n- Optimizing slow PostgreSQL queries\n- Designing indexing strategies\n- Analyzing database performance\n- Tuning PostgreSQL configuration\n- Managing production databases\n\n## Workflow Phases\n\n### Phase 1: Performance Assessment\n\n#### Skills to Invoke\n- `database-optimizer` - Database optimization\n- `postgres-best-practices` - PostgreSQL best practices\n\n#### Actions\n1. Check database version\n2. Review configuration\n3. Analyze slow queries\n4. Check resource usage\n5. Identify bottlenecks\n\n#### Copy-Paste Prompts\n```\nUse @database-optimizer to assess PostgreSQL performance\n```\n\n### Phase 2: Query Analysis\n\n#### Skills to Invoke\n- `sql-optimization-patterns` - SQL optimization\n- `postgres-best-practices` - PostgreSQL patterns\n\n#### Actions\n1. Run EXPLAIN ANALYZE\n2. Identify scan types\n3. Check join strategies\n4. Analyze execution time\n5. Find optimization opportunities\n\n#### Copy-Paste Prompts\n```\nUse @sql-optimization-patterns to analyze and optimize queries\n```\n\n### Phase 3: Indexing Strategy\n\n#### Skills to Invoke\n- `database-design` - Index design\n- `postgresql` - PostgreSQL indexing\n\n#### Actions\n1. Identify missing indexes\n2. Create B-tree indexes\n3. Add composite indexes\n4. Consider partial indexes\n5. Review index usage\n\n#### Copy-Paste Prompts\n```\nUse @database-design to design PostgreSQL indexing strategy\n```\n\n### Phase 4: Query Optimization\n\n#### Skills to Invoke\n- `sql-optimization-patterns` - Query tuning\n- `sql-pro` - SQL expertise\n\n#### Actions\n1. Rewrite inefficient queries\n2. Optimize joins\n3. Add CTEs where helpful\n4. Implement pagination\n5. Test improvements\n\n#### Copy-Paste Prompts\n```\nUse @sql-optimization-patterns to optimize SQL queries\n```\n\n### Phase 5: Configuration Tuning\n\n#### Skills to Invoke\n- `postgres-best-practices` - Configuration\n- `database-admin` - Database administration\n\n#### Actions\n1. Tune shared_buffers\n2. Configure work_mem\n3. Set effective_cache_size\n4. Adjust checkpoint settings\n5. Configure autovacuum\n\n#### Copy-Paste Prompts\n```\nUse @postgres-best-practices to tune PostgreSQL configuration\n```\n\n### Phase 6: Maintenance\n\n#### Skills to Invoke\n- `database-admin` - Database maintenance\n- `postgresql` - PostgreSQL maintenance\n\n#### Actions\n1. Schedule VACUUM\n2. Run ANALYZE\n3. Check table bloat\n4. Monitor autovacuum\n5. Review statistics\n\n#### Copy-Paste Prompts\n```\nUse @database-admin to schedule PostgreSQL maintenance\n```\n\n### Phase 7: Monitoring\n\n#### Skills to Invoke\n- `grafana-dashboards` - Monitoring dashboards\n- `prometheus-configuration` - Metrics collection\n\n#### Actions\n1. Set up monitoring\n2. Create dashboards\n3. Configure alerts\n4. Track key metrics\n5. Review trends\n\n#### Copy-Paste Prompts\n```\nUse @grafana-dashboards to create PostgreSQL monitoring\n```\n\n## Optimization Checklist\n\n- [ ] Slow queries identified\n- [ ] Indexes optimized\n- [ ] Configuration tuned\n- [ ] Maintenance scheduled\n- [ ] Monitoring active\n- [ ] Performance improved\n\n## Quality Gates\n\n- [ ] Query performance improved\n- [ ] Indexes effective\n- [ ] Configuration optimized\n- [ ] Maintenance automated\n- [ ] Monitoring in place\n\n## Related Workflow Bundles\n\n- `database` - Database operations\n- `cloud-devops` - Infrastructure\n- `performance-optimization` - Performance\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n","","imported","https:\u002F\u002Fgithub.com\u002Fsickn33\u002Fantigravity-awesome-skills","user_system_seed","SkillOPIC",true,58,663,"2026-05-16 13:34:27",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"编程开发","coding","mdi-code-braces","代码生成、调试、审查，提升开发效率",2,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":25,"skillCount":32,"createdAt":26},"后端开发","backend","mdi-server","API、数据库、服务端架构",296,[34],{"id":35,"skillId":4,"version":36,"fileName":37,"fileSize":38,"filePath":39,"fileHash":40,"manifest":41,"createdAt":19},"2bf60e1c-ccf1-457e-8c49-f1f1869a4cdc","1.0.0","postgresql-optimization.zip",1559,"uploads\u002Fskills\u002Fed9b6a8a-423d-4959-8660-999a7d012d38\u002Fpostgresql-optimization.zip","551795b31635d6a031395c0c09554d6b4eab028eef22affa5bd5510d266cd7c0","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":4122}]",{"code":43,"message":44,"data":45},200,"success",{"items":46,"stats":47,"page":50},[],{"averageRating":48,"totalRatings":48,"ratingCounts":49},0,[48,48,48,48,48],{"limit":51,"offset":48,"hasMore":52,"nextOffset":51,"ratedOnly":16},15,false]