[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CBXDWS1H91308YG6BFYG15":3,"skill-same:01M7CBXDWS1H91308YG6BFYG15":55},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":33,"commitSha":34,"skillDirectory":35,"forksCount":36,"repositoryHtmlUrl":37,"repositoryHomepageUrl":6,"ownerHtmlUrl":38,"ownerBlogUrl":6,"ownerDescription":39,"updatedAt":40,"install":41,"resources":54},"01M7CBXDWS1H91308YG6BFYG15","database-optimizer",null,"Optimizes database queries and improves performance across PostgreSQL and MySQL systems. Use when investigating slow queries, analyzing execution plans, or optimizing database performance. Invoke for index design, query rewrites, configuration tuning, partitioning strategies, lock contention resolution.","om-scogo\u002Fskillsh-scraper","om-scogo","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F160466840?v=4","01M79AWB6DFVCQ7RK70CS34B96","Om Achrekar","01M79AWB6ZM9SKR8KDH1WSSM22",0,"MIT","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fjeffallan-claude-skills\u002Fdatabase-optimizer\u002Fskills\u002Fdatabase-optimizer\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: database-optimizer\ndescription: Optimizes database queries and improves performance across PostgreSQL and MySQL systems. Use when investigating slow queries, analyzing execution plans, or optimizing database performance. Invoke for index design, query rewrites, configuration tuning, partitioning strategies, lock contention resolution.\nlicense: MIT\nmetadata:\n  author: https:\u002F\u002Fgithub.com\u002FJeffallan\n  version: \"1.1.1\"\n  domain: infrastructure\n  triggers: database optimization, slow query, query performance, database tuning, index optimization, execution plan, EXPLAIN ANALYZE, database performance, PostgreSQL optimization, MySQL optimization\n  role: specialist\n  scope: optimization\n  output-format: analysis-and-code\n  related-skills: devops-engineer, postgres-pro, graphql-architect\n---\n\n# Database Optimizer\n\nSenior database optimizer with expertise in performance tuning, query optimization, and scalability across multiple database systems.\n\n## When to Use This Skill\n\n- Analyzing slow queries and execution plans\n- Designing optimal index strategies\n- Tuning database configuration parameters\n- Optimizing schema design and partitioning\n- Reducing lock contention and deadlocks\n- Improving cache hit rates and memory usage\n\n## Core Workflow\n\n1. **Analyze Performance** — Capture baseline metrics and run `EXPLAIN ANALYZE` before any changes\n2. **Identify Bottlenecks** — Find inefficient queries, missing indexes, config issues\n3. **Design Solutions** — Create index strategies, query rewrites, schema improvements\n4. **Implement Changes** — Apply optimizations incrementally with monitoring; validate each change before proceeding to the next\n5. **Validate Results** — Re-run `EXPLAIN ANALYZE`, compare costs, measure wall-clock improvement, document changes\n\n> ⚠️ Always test changes in non-production first. Revert immediately if write performance degrades or replication lag increases.\n\n## Reference Guide\n\nLoad detailed guidance based on context:\n\n| Topic | Reference | Load When |\n|-------|-----------|-----------|\n| Query Optimization | `references\u002Fquery-optimization.md` | Analyzing slow queries, execution plans |\n| Index Strategies | `references\u002Findex-strategies.md` | Designing indexes, covering indexes |\n| PostgreSQL Tuning | `references\u002Fpostgresql-tuning.md` | PostgreSQL-specific optimizations |\n| MySQL Tuning | `references\u002Fmysql-tuning.md` | MySQL-specific optimizations |\n| Monitoring & Analysis | `references\u002Fmonitoring-analysis.md` | Performance metrics, diagnostics |\n\n## Common Operations & Examples\n\n### Identify Top Slow Queries (PostgreSQL)\n```sql\n-- Requires pg_stat_statements extension\nSELECT query,\n       calls,\n       round(total_exec_time::numeric, 2)  AS total_ms,\n       round(mean_exec_time::numeric, 2)   AS mean_ms,\n       round(stddev_exec_time::numeric, 2) AS stddev_ms,\n       rows\nFROM   pg_stat_statements\nORDER  BY mean_exec_time DESC\nLIMIT  20;\n```\n\n### Capture an Execution Plan\n```sql\n-- Use BUFFERS to expose cache hit vs. disk read ratio\nEXPLAIN (ANALYZE, BUFFERS, FORMAT TEXT)\nSELECT o.id, c.name\nFROM   orders o\nJOIN   customers c ON c.id = o.customer_id\nWHERE  o.status = 'pending'\n  AND  o.created_at > now() - interval '7 days';\n```\n\n### Reading EXPLAIN Output — Key Patterns to Find\n\n| Pattern | Symptom | Typical Remedy |\n|---------|---------|----------------|\n| `Seq Scan` on large table | High row estimate, no filter selectivity | Add B-tree index on filter column |\n| `Nested Loop` with large outer set | Exponential row growth in inner loop | Consider Hash Join; index inner join key |\n| `cost=... rows=1` but actual rows=50000 | Stale statistics | Run `ANALYZE \u003Ctable>;` |\n| `Buffers: hit=10 read=90000` | Low buffer cache hit rate | Increase `shared_buffers`; add covering index |\n| `Sort Method: external merge` | Sort spilling to disk | Increase `work_mem` for the session |\n\n### Create a Covering Index\n```sql\n-- Covers the filter AND the projected columns, eliminating a heap fetch\nCREATE INDEX CONCURRENTLY idx_orders_status_created_covering\n    ON orders (status, created_at)\n    INCLUDE (customer_id, total_amount);\n```\n\n### Validate Improvement\n```sql\n-- Before optimization: save plan & timing\nEXPLAIN (ANALYZE, BUFFERS) \u003Cquery>;   -- note \"Execution Time: X ms\"\n\n-- After optimization: compare\nEXPLAIN (ANALYZE, BUFFERS) \u003Cquery>;   -- target meaningful reduction in cost & time\n\n-- Confirm index is actually used\nSELECT indexname, idx_scan, idx_tup_read, idx_tup_fetch\nFROM   pg_stat_user_indexes\nWHERE  relname = 'orders';\n```\n\n### MySQL: Find Slow Queries\n```sql\n-- Inspect slow query log candidates\nSELECT * FROM performance_schema.events_statements_summary_by_digest\nORDER  BY SUM_TIMER_WAIT DESC\nLIMIT  20;\n\n-- Execution plan\nEXPLAIN FORMAT=JSON\nSELECT * FROM orders WHERE status = 'pending' AND created_at > NOW() - INTERVAL 7 DAY;\n```\n\n## Constraints\n\n### MUST DO\n- Capture `EXPLAIN (ANALYZE, BUFFERS)` output **before** optimizing — this is the baseline\n- Measure performance before and after every change\n- Create indexes with `CONCURRENTLY` (PostgreSQL) to avoid table locks\n- Test in non-production; roll back if write performance or replication lag worsens\n- Document all optimization decisions with before\u002Fafter metrics\n- Run `ANALYZE` after bulk data changes to refresh statistics\n\n### MUST NOT DO\n- Apply optimizations without a measured baseline\n- Create redundant or unused indexes\n- Make multiple changes simultaneously (impossible to attribute impact)\n- Ignore write amplification caused by new indexes\n- Neglect `VACUUM` \u002F statistics maintenance\n\n## Output Templates\n\nWhen optimizing database performance, provide:\n1. Performance analysis with baseline metrics (query time, cost, buffer hit ratio)\n2. Identified bottlenecks and root causes (with EXPLAIN evidence)\n3. Optimization strategy with specific changes\n4. Implementation SQL \u002F config changes\n5. Validation queries to measure improvement\n6. Monitoring recommendations\n\n[Documentation](https:\u002F\u002Fjeffallan.github.io\u002Fclaude-skills\u002Fskills\u002Finfrastructure\u002Fdatabase-optimizer\u002F)\n","# Database Optimizer\n\nSenior database optimizer with expertise in performance tuning, query optimization, and scalability across multiple database systems.\n\n## When to Use This Skill\n\n- Analyzing slow queries and execution plans\n- Designing optimal index strategies\n- Tuning database configuration parameters\n- Optimizing schema design and partitioning\n- Reducing lock contention and deadlocks\n- Improving cache hit rates and memory usage\n\n## Core Workflow\n\n1. **Analyze Performance** — Capture baseline metrics and run `EXPLAIN ANALYZE` before any changes\n2. **Identify Bottlenecks** — Find inefficient queries, missing indexes, config issues\n3. **Design Solutions** — Create index strategies, query rewrites, schema improvements\n4. **Implement Changes** — Apply optimizations incrementally with monitoring; validate each change before proceeding to the next\n5. **Validate Results** — Re-run `EXPLAIN ANALYZE`, compare costs, measure wall-clock improvement, document changes\n\n> ⚠️ Always test changes in non-production first. Revert immediately if write performance degrades or replication lag increases.\n\n## Reference Guide\n\nLoad detailed guidance based on context:\n\n| Topic | Reference | Load When |\n|-------|-----------|-----------|\n| Query Optimization | `references\u002Fquery-optimization.md` | Analyzing slow queries, execution plans |\n| Index Strategies | `references\u002Findex-strategies.md` | Designing indexes, covering indexes |\n| PostgreSQL Tuning | `references\u002Fpostgresql-tuning.md` | PostgreSQL-specific optimizations |\n| MySQL Tuning | `references\u002Fmysql-tuning.md` | MySQL-specific optimizations |\n| Monitoring & Analysis | `references\u002Fmonitoring-analysis.md` | Performance metrics, diagnostics |\n\n## Common Operations & Examples\n\n### Identify Top Slow Queries (PostgreSQL)\n```sql\n-- Requires pg_stat_statements extension\nSELECT query,\n       calls,\n       round(total_exec_time::numeric, 2)  AS total_ms,\n       round(mean_exec_time::numeric, 2)   AS mean_ms,\n       round(stddev_exec_time::numeric, 2) AS stddev_ms,\n       rows\nFROM   pg_stat_statements\nORDER  BY mean_exec_time DESC\nLIMIT  20;\n```\n\n### Capture an Execution Plan\n```sql\n-- Use BUFFERS to expose cache hit vs. disk read ratio\nEXPLAIN (ANALYZE, BUFFERS, FORMAT TEXT)\nSELECT o.id, c.name\nFROM   orders o\nJOIN   customers c ON c.id = o.customer_id\nWHERE  o.status = 'pending'\n  AND  o.created_at > now() - interval '7 days';\n```\n\n### Reading EXPLAIN Output — Key Patterns to Find\n\n| Pattern | Symptom | Typical Remedy |\n|---------|---------|----------------|\n| `Seq Scan` on large table | High row estimate, no filter selectivity | Add B-tree index on filter column |\n| `Nested Loop` with large outer set | Exponential row growth in inner loop | Consider Hash Join; index inner join key |\n| `cost=... rows=1` but actual rows=50000 | Stale statistics | Run `ANALYZE \u003Ctable>;` |\n| `Buffers: hit=10 read=90000` | Low buffer cache hit rate | Increase `shared_buffers`; add covering index |\n| `Sort Method: external merge` | Sort spilling to disk | Increase `work_mem` for the session |\n\n### Create a Covering Index\n```sql\n-- Covers the filter AND the projected columns, eliminating a heap fetch\nCREATE INDEX CONCURRENTLY idx_orders_status_created_covering\n    ON orders (status, created_at)\n    INCLUDE (customer_id, total_amount);\n```\n\n### Validate Improvement\n```sql\n-- Before optimization: save plan & timing\nEXPLAIN (ANALYZE, BUFFERS) \u003Cquery>;   -- note \"Execution Time: X ms\"\n\n-- After optimization: compare\nEXPLAIN (ANALYZE, BUFFERS) \u003Cquery>;   -- target meaningful reduction in cost & time\n\n-- Confirm index is actually used\nSELECT indexname, idx_scan, idx_tup_read, idx_tup_fetch\nFROM   pg_stat_user_indexes\nWHERE  relname = 'orders';\n```\n\n### MySQL: Find Slow Queries\n```sql\n-- Inspect slow query log candidates\nSELECT * FROM performance_schema.events_statements_summary_by_digest\nORDER  BY SUM_TIMER_WAIT DESC\nLIMIT  20;\n\n-- Execution plan\nEXPLAIN FORMAT=JSON\nSELECT * FROM orders WHERE status = 'pending' AND created_at > NOW() - INTERVAL 7 DAY;\n```\n\n## Constraints\n\n### MUST DO\n- Capture `EXPLAIN (ANALYZE, BUFFERS)` output **before** optimizing — this is the baseline\n- Measure performance before and after every change\n- Create indexes with `CONCURRENTLY` (PostgreSQL) to avoid table locks\n- Test in non-production; roll back if write performance or replication lag worsens\n- Document all optimization decisions with before\u002Fafter metrics\n- Run `ANALYZE` after bulk data changes to refresh statistics\n\n### MUST NOT DO\n- Apply optimizations without a measured baseline\n- Create redundant or unused indexes\n- Make multiple changes simultaneously (impossible to attribute impact)\n- Ignore write amplification caused by new indexes\n- Neglect `VACUUM` \u002F statistics maintenance\n\n## Output Templates\n\nWhen optimizing database performance, provide:\n1. Performance analysis with baseline metrics (query time, cost, buffer hit ratio)\n2. Identified bottlenecks and root causes (with EXPLAIN evidence)\n3. Optimization strategy with specific changes\n4. Implementation SQL \u002F config changes\n5. Validation queries to measure improvement\n6. Monitoring recommendations\n\n[Documentation](https:\u002F\u002Fjeffallan.github.io\u002Fclaude-skills\u002Fskills\u002Finfrastructure\u002Fdatabase-optimizer\u002F)\n",{"name":5,"license":15,"metadata":24,"description":7},{"role":25,"scope":26,"author":27,"domain":28,"version":29,"triggers":30,"output-format":31,"related-skills":32},"specialist","optimization","https:\u002F\u002Fgithub.com\u002FJeffallan","infrastructure","1.1.1","database optimization, slow query, query performance, database tuning, index optimization, execution plan, EXPLAIN ANALYZE, database performance, PostgreSQL optimization, MySQL optimization","analysis-and-code","devops-engineer, postgres-pro, graphql-architect","main","8859218955d9504cd18b59e7892100718039d3b4","data\u002Fskills\u002Fjeffallan-claude-skills\u002Fdatabase-optimizer\u002Fskills\u002Fdatabase-optimizer",1,"https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper","https:\u002F\u002Fgithub.com\u002Fom-scogo","SDE-1 @ Scogo ","2026-07-18 12:22:46",{"source":8,"skillName":5,"commands":42,"prompt":52,"zipAvailable":53},[43,46,49],{"tool":44,"command":45},"npx","npx skills add om-scogo\u002Fskillsh-scraper --skill database-optimizer",{"tool":47,"command":48},"bunx","bunx skills add om-scogo\u002Fskillsh-scraper --skill database-optimizer",{"tool":50,"command":51},"pnpm","pnpm dlx skills add om-scogo\u002Fskillsh-scraper --skill database-optimizer","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fjeffallan-claude-skills\u002Fdatabase-optimizer\u002Fskills\u002Fdatabase-optimizer\u002FSKILL.md",true,[],[56,63,68,75,80,87],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M7D6MC9FAAEV4CMNYX8W7JTG","arxiv-search","Search arXiv physics, math, and computer science preprints using natural language queries. Powered by Valyu semantic search.","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fyorkeccak-scientific-skills\u002Farxiv-search\u002Fskills\u002Farxiv-search\u002FSKILL.md",[],[],{"skillNo":64,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M7D6M85CKKN87TA98VCQV4H7","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fyorkeccak-scientific-skills\u002Farxiv-search\u002FSkill.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M7D4ZTCS4DR3CE4JY06X84T2","working-with-legacy-code","Safely change and test untested codebases using Feathers' \"Working Effectively with Legacy Code\". Use when the user mentions \"legacy code\", \"no tests\", \"untested codebase\", \"how do I test this\", \"seams\", \"characterization tests\", \"golden master\", \"sprout method\", \"afraid to change this code\", \"monster method\", \"dependency breaking\", or \"inherited a messy codebase\". Also trigger when changing code without tests safely, getting a class under test when constructors, statics, or singletons block it, adding features to tangled modules, or planning incremental test coverage for an old codebase. Covers the legacy-code change algorithm, seams, characterization tests, sprout\u002Fwrap, and dependency-breaking techniques. For refactoring code that already has tests, see refactoring-patterns. For day-to-day code quality, see clean-code.","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fworking-with-legacy-code\u002Fworking-with-legacy-code\u002FSKILL.md",[],[],{"skillNo":76,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M7D4ZHZKJD2RSNGAF63V14P4","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fworking-with-legacy-code\u002FSkill.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M7D4ZB4CJBFW5JE67CPH2QRV","web-typography","Select, pair, and implement typefaces for web projects. Use when the user mentions \"font pairing\", \"which typeface\", \"line height\", \"responsive typography\", \"web font loading\", \"type hierarchy\", \"variable fonts\", \"FOUT\u002FFOIT\", \"typographic scale\", or \"the text is hard to read\". Also trigger when choosing between system fonts and web fonts, optimizing font-loading performance, or designing readable long-form content. Covers readability evaluation, CSS implementation, and performance optimization. For overall UI design systems, see refactoring-ui. For dramatic typographic experiences, see top-design.","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fweb-typography\u002Fweb-typography\u002FSKILL.md",[],[],{"skillNo":88,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M7D4Z4MVYVY3NMJ18BNV6WNA","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fweb-typography\u002FSkill.md",[],[]]