[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75NE64WGJTNTKW3RYVC7394":3,"skill-same:01M75NE64WGJTNTKW3RYVC7394":49},{"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":27,"commitSha":28,"skillDirectory":29,"forksCount":14,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":32,"ownerDescription":33,"updatedAt":34,"install":35,"resources":48},"01M75NE64WGJTNTKW3RYVC7394","postgres-query-performance",null,"Diagnose and fix slow PostgreSQL queries with indexes and EXPLAIN","linktogo\u002Fmaggie","linktogo","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F29751338?v=4","01M75NBAKP44KV5ND0WEE3H87P","Fabien Brunet","01M75NBAMC2TEQQ8FMTBA23MET",2,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Flinktogo\u002Fmaggie\u002Fblob\u002Fmain\u002Fskills\u002Fpostgres\u002Fquery-performance\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: postgres-query-performance\ndescription: Diagnose and fix slow PostgreSQL queries with indexes and EXPLAIN\nglobs: [\"**\u002F*.sql\", \"**\u002F*.repository.ts\"]\n---\n\n# PostgreSQL query performance\n\nBefore optimizing, measure. Guessing at indexes wastes time and disk.\n\n## Diagnose\n\n- Run `EXPLAIN (ANALYZE, BUFFERS)` on the real query with realistic parameters.\n- Watch for `Seq Scan` on large tables in the hot path, high `rows` estimates\n  that diverge from actual, and nested-loop joins over big row counts.\n- Reproduce against production-sized data — plans flip as tables grow.\n\n## Fix\n\n- Index the columns used in `WHERE`, `JOIN`, and `ORDER BY`. A composite index\n  order matters: most selective \u002F equality columns first, range columns last.\n- Add partial indexes for queries that always filter the same predicate\n  (`WHERE deleted_at IS NULL`).\n- Select only the columns you need; avoid `SELECT *` in application queries.\n- Kill N+1 patterns: fetch related rows in one query with a join or\n  `WHERE id = ANY($1)` rather than a query per parent row.\n- Keep transactions short; long-running ones bloat dead tuples and block\n  `VACUUM`.\n\n## Verify\n\nRe-run `EXPLAIN ANALYZE` after the change and confirm the plan uses the index\nand the total time dropped. An index that the planner ignores is dead weight —\nremove it.\n","# PostgreSQL query performance\n\nBefore optimizing, measure. Guessing at indexes wastes time and disk.\n\n## Diagnose\n\n- Run `EXPLAIN (ANALYZE, BUFFERS)` on the real query with realistic parameters.\n- Watch for `Seq Scan` on large tables in the hot path, high `rows` estimates\n  that diverge from actual, and nested-loop joins over big row counts.\n- Reproduce against production-sized data — plans flip as tables grow.\n\n## Fix\n\n- Index the columns used in `WHERE`, `JOIN`, and `ORDER BY`. A composite index\n  order matters: most selective \u002F equality columns first, range columns last.\n- Add partial indexes for queries that always filter the same predicate\n  (`WHERE deleted_at IS NULL`).\n- Select only the columns you need; avoid `SELECT *` in application queries.\n- Kill N+1 patterns: fetch related rows in one query with a join or\n  `WHERE id = ANY($1)` rather than a query per parent row.\n- Keep transactions short; long-running ones bloat dead tuples and block\n  `VACUUM`.\n\n## Verify\n\nRe-run `EXPLAIN ANALYZE` after the change and confirm the plan uses the index\nand the total time dropped. An index that the planner ignores is dead weight —\nremove it.\n",{"name":5,"globs":24,"description":7},[25,26],"**\u002F*.sql","**\u002F*.repository.ts","main","d884e3c730aa8243273458fa6d7de64bfd3b8bba","skills\u002Fpostgres\u002Fquery-performance","https:\u002F\u002Fgithub.com\u002Flinktogo\u002Fmaggie","https:\u002F\u002Fgithub.com\u002Flinktogo","http:\u002F\u002Ffabien-brunet.fr\u002F","Software Architect @Capgemini","2026-11-14 21:45:09",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add linktogo\u002Fmaggie --skill postgres-query-performance",{"tool":41,"command":42},"bunx","bunx skills add linktogo\u002Fmaggie --skill postgres-query-performance",{"tool":44,"command":45},"pnpm","pnpm dlx skills add linktogo\u002Fmaggie --skill postgres-query-performance","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flinktogo\u002Fmaggie\u002Fblob\u002Fmain\u002Fskills\u002Fpostgres\u002Fquery-performance\u002FSKILL.md",true,[],[50,57,64,71,78,85],{"skillNo":51,"name":52,"nameZh":6,"description":53,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":19},"01M75NEGXZPJFCHAE5P31CQX94","vuejs-state-management","Manage Vue application state with Pinia and the right state locality","https:\u002F\u002Fgithub.com\u002Flinktogo\u002Fmaggie\u002Fblob\u002Fmain\u002Fskills\u002Fvuejs\u002Fstate-management\u002FSKILL.md",[],[],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M75NEEHT92D2SPZFEWBMSVX9","vuejs-composition-api","Write Vue 3 components with the Composition API, script setup, and composables","https:\u002F\u002Fgithub.com\u002Flinktogo\u002Fmaggie\u002Fblob\u002Fmain\u002Fskills\u002Fvuejs\u002Fcomposition-api\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M75NEBQJKWVJG8CYZQQB4BFQ","reactjs-hooks","Use React hooks correctly — dependencies, effects, and custom hooks","https:\u002F\u002Fgithub.com\u002Flinktogo\u002Fmaggie\u002Fblob\u002Fmain\u002Fskills\u002Freactjs\u002Fhooks\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M75NE9V7AYPA9QF9H21TKC08","reactjs-component-design","Write small, composable React components with clean props and no needless state","https:\u002F\u002Fgithub.com\u002Flinktogo\u002Fmaggie\u002Fblob\u002Fmain\u002Fskills\u002Freactjs\u002Fcomponent-design\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M75NE3KGES659BWDAZDM6YQ5","postgres-migrations","Write safe, reversible, zero-downtime PostgreSQL schema migrations","https:\u002F\u002Fgithub.com\u002Flinktogo\u002Fmaggie\u002Fblob\u002Fmain\u002Fskills\u002Fpostgres\u002Fmigrations\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"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},"01M75NE106KTAH8BH7QCFZV74A","nx-task-running","Run Nx tasks efficiently with affected, caching, and target dependencies","https:\u002F\u002Fgithub.com\u002Flinktogo\u002Fmaggie\u002Fblob\u002Fmain\u002Fskills\u002Fnx\u002Ftask-running\u002FSKILL.md",[],[]]