[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6GXH22YZZ9AES24EB27BGNX":3,"skill-same:01M6GXH22YZZ9AES24EB27BGNX":70},{"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":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":47,"commitSha":48,"skillDirectory":49,"forksCount":50,"repositoryHtmlUrl":51,"repositoryHomepageUrl":51,"ownerHtmlUrl":52,"ownerBlogUrl":53,"ownerDescription":54,"updatedAt":55,"install":56,"resources":69},"01M6GXH22YZZ9AES24EB27BGNX","SQL Query Review",null,"Deep review of SQL queries — execution plans, index utilization, join efficiency, subquery patterns, locking behavior, and performance anti-patterns.","malayvuong\u002Fagent-orchestra","malayvuong","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F13240975?v=4","01M6GXCDVPB2VPZMDZK1KF98M0","Nguyen Minh Vuong","01M6GXCE176VDX3XV4Z4KNR33J",1,"MIT","https:\u002F\u002Fgithub.com\u002Fmalayvuong\u002Fagent-orchestra\u002Fblob\u002Fmain\u002F.agent-orchestra\u002Fskills\u002Fsql-query-review\u002FSKILL.md",[],[5,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"sql","query","review","anti-patterns","join","plans","logic","deep","efficiency","queries","sql queries","utilization","behavior","select","explain","execution","index","deep review","performance","2026-11-10 10:12:30",false,"---\nname: SQL Query Review\ndescription: Deep review of SQL queries — execution plans, index utilization, join efficiency, subquery patterns, locking behavior, and performance anti-patterns.\nversion: 2026.3.1\nlicense: MIT\ntriggers:\n  lenses:\n    - performance\n    - logic\n  keywords:\n    - sql\n    - query\n    - select\n    - join\n    - index\n    - explain\n---\n\nWhen reviewing SQL queries, apply the following checks.\n\n## Full Table Scans\n\nFlag `SELECT *` on large tables — specify only needed columns. Flag queries without a `WHERE` clause on tables with more than a few hundred rows. Check that `WHERE` clause columns have supporting indexes.\n\nFlag `LIKE '%pattern%'` (leading wildcard) — this cannot use an index. Flag `OR` conditions on different columns — these often prevent index usage; consider rewriting as `UNION ALL`. Flag function calls on indexed columns in `WHERE` clauses (`WHERE YEAR(created_at) = 2026`) — this prevents index usage; rewrite as range conditions.\n\n## Join Efficiency\n\nVerify join columns have indexes on both sides. Flag `CROSS JOIN` without explicit intent documentation — it produces a Cartesian product. Flag implicit joins (`FROM a, b WHERE a.id = b.a_id`) — use explicit `JOIN ... ON` syntax.\n\nCheck join order for large tables — the optimizer usually handles this, but flag forced join orders (`STRAIGHT_JOIN`) without justification. Flag joins on non-indexed columns between large tables — this causes nested loop scans.\n\n## Subquery Anti-Patterns\n\nFlag correlated subqueries in `SELECT` or `WHERE` clauses — these execute once per row in the outer query. Rewrite as `JOIN` or use a CTE. Flag `IN (SELECT ...)` on large result sets — rewrite as `EXISTS` or `JOIN`.\n\nFlag `SELECT` inside `SELECT` that could be a window function. Check that CTEs (`WITH` clauses) are not used for premature materialization — on some databases, CTEs are optimization fences.\n\n## N+1 in Application Code\n\nWhen reviewing queries generated by an ORM, flag patterns where a query inside a loop produces one SQL statement per iteration. Check for:\n\n- Loop over a collection with a `.load()` or `.find()` call per item\n- Template rendering that triggers lazy-loaded relationship queries\n- API serialization that accesses related objects without eager loading\n\n## Index Design\n\nFlag redundant indexes: if `(a, b)` composite exists, a standalone `(a)` index is redundant. Flag indexes on low-cardinality columns (boolean, status with \u003C 5 values) unless used in combination with selective columns.\n\nCheck that unique constraints exist for natural keys. Flag tables where uniqueness is enforced only at the application level — the database should be the source of truth.\n\nVerify covering indexes are considered for frequently-run read queries — all columns in `SELECT`, `WHERE`, and `ORDER BY` in a single index avoids table lookups.\n\n## Locking and Concurrency\n\nFlag `SELECT ... FOR UPDATE` on ranges that could be narrowed. Flag long-running transactions that hold row locks — keep transaction scope minimal. Check for potential deadlocks from transactions that lock tables in different orders.\n\nFlag `LOCK TABLE` in application code — use row-level locking instead. Verify read-heavy queries use `READ COMMITTED` or appropriate isolation level — `SERIALIZABLE` has significant overhead.\n\n## Data Type Efficiency\n\nFlag `VARCHAR(255)` as a default when shorter lengths are known. Flag `TEXT` or `BLOB` for columns that should have length constraints. Check that numeric types match the expected range — `BIGINT` for IDs that will never exceed `INT` range wastes storage.\n\nFlag storing dates as strings — use native `DATE`, `TIMESTAMP`, or `TIMESTAMPTZ` types. Check timezone handling: verify `TIMESTAMP WITH TIME ZONE` is used for user-facing timestamps.\n\nFor each finding, report: the query or table, the specific performance or correctness issue, and the recommended fix.\n","When reviewing SQL queries, apply the following checks.\n\n## Full Table Scans\n\nFlag `SELECT *` on large tables — specify only needed columns. Flag queries without a `WHERE` clause on tables with more than a few hundred rows. Check that `WHERE` clause columns have supporting indexes.\n\nFlag `LIKE '%pattern%'` (leading wildcard) — this cannot use an index. Flag `OR` conditions on different columns — these often prevent index usage; consider rewriting as `UNION ALL`. Flag function calls on indexed columns in `WHERE` clauses (`WHERE YEAR(created_at) = 2026`) — this prevents index usage; rewrite as range conditions.\n\n## Join Efficiency\n\nVerify join columns have indexes on both sides. Flag `CROSS JOIN` without explicit intent documentation — it produces a Cartesian product. Flag implicit joins (`FROM a, b WHERE a.id = b.a_id`) — use explicit `JOIN ... ON` syntax.\n\nCheck join order for large tables — the optimizer usually handles this, but flag forced join orders (`STRAIGHT_JOIN`) without justification. Flag joins on non-indexed columns between large tables — this causes nested loop scans.\n\n## Subquery Anti-Patterns\n\nFlag correlated subqueries in `SELECT` or `WHERE` clauses — these execute once per row in the outer query. Rewrite as `JOIN` or use a CTE. Flag `IN (SELECT ...)` on large result sets — rewrite as `EXISTS` or `JOIN`.\n\nFlag `SELECT` inside `SELECT` that could be a window function. Check that CTEs (`WITH` clauses) are not used for premature materialization — on some databases, CTEs are optimization fences.\n\n## N+1 in Application Code\n\nWhen reviewing queries generated by an ORM, flag patterns where a query inside a loop produces one SQL statement per iteration. Check for:\n\n- Loop over a collection with a `.load()` or `.find()` call per item\n- Template rendering that triggers lazy-loaded relationship queries\n- API serialization that accesses related objects without eager loading\n\n## Index Design\n\nFlag redundant indexes: if `(a, b)` composite exists, a standalone `(a)` index is redundant. Flag indexes on low-cardinality columns (boolean, status with \u003C 5 values) unless used in combination with selective columns.\n\nCheck that unique constraints exist for natural keys. Flag tables where uniqueness is enforced only at the application level — the database should be the source of truth.\n\nVerify covering indexes are considered for frequently-run read queries — all columns in `SELECT`, `WHERE`, and `ORDER BY` in a single index avoids table lookups.\n\n## Locking and Concurrency\n\nFlag `SELECT ... FOR UPDATE` on ranges that could be narrowed. Flag long-running transactions that hold row locks — keep transaction scope minimal. Check for potential deadlocks from transactions that lock tables in different orders.\n\nFlag `LOCK TABLE` in application code — use row-level locking instead. Verify read-heavy queries use `READ COMMITTED` or appropriate isolation level — `SERIALIZABLE` has significant overhead.\n\n## Data Type Efficiency\n\nFlag `VARCHAR(255)` as a default when shorter lengths are known. Flag `TEXT` or `BLOB` for columns that should have length constraints. Check that numeric types match the expected range — `BIGINT` for IDs that will never exceed `INT` range wastes storage.\n\nFlag storing dates as strings — use native `DATE`, `TIMESTAMP`, or `TIMESTAMPTZ` types. Check timezone handling: verify `TIMESTAMP WITH TIME ZONE` is used for user-facing timestamps.\n\nFor each finding, report: the query or table, the specific performance or correctness issue, and the recommended fix.\n",{"name":5,"license":15,"version":43,"triggers":44,"description":7},"2026.3.1",{"lenses":45,"keywords":46},[37,25],[19,20,32,23,35,33],"main","eac6069a8690d89fd23f08d2d14e4874ed376a77",".agent-orchestra\u002Fskills\u002Fsql-query-review",0,"https:\u002F\u002Fgithub.com\u002Fmalayvuong\u002Fagent-orchestra","https:\u002F\u002Fgithub.com\u002Fmalayvuong","www.malayvuong.com","Just a newbie at everything","2026-10-09 12:52:45",{"source":8,"skillName":5,"commands":57,"prompt":67,"zipAvailable":68},[58,61,64],{"tool":59,"command":60},"npx","npx skills add malayvuong\u002Fagent-orchestra --skill \"SQL Query Review\"",{"tool":62,"command":63},"bunx","bunx skills add malayvuong\u002Fagent-orchestra --skill \"SQL Query Review\"",{"tool":65,"command":66},"pnpm","pnpm dlx skills add malayvuong\u002Fagent-orchestra --skill \"SQL Query Review\"","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmalayvuong\u002Fagent-orchestra\u002Fblob\u002Fmain\u002F.agent-orchestra\u002Fskills\u002Fsql-query-review\u002FSKILL.md",true,[],[71,93,113,131,149,165],{"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":38},"01M6GXHYPRJ43SHFPFJTF87GS8","Vue.js Review","Deep review of Vue.js applications — Composition API patterns, reactivity traps, component design, Pinia state management, and performance pitfalls.","https:\u002F\u002Fgithub.com\u002Fmalayvuong\u002Fagent-orchestra\u002Fblob\u002Fmain\u002F.agent-orchestra\u002Fskills\u002Fvue-review\u002FSKILL.md",[],[21,78,79,80,81,37,82,83,84,36,85,86,87,88,89,90,26,25,91,92],"vue","js","Vue js Review","design","component","state management","state","api patterns","applications","api","Composition","pinia","management","pitfalls","pinia state",{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":38},"01M6GXHSPDDH1PQEN61ENMCEF5","Unity Review","Deep review of Unity C# code — object pooling, Update allocation, physics patterns, UI performance, serialization, and mobile optimization.","https:\u002F\u002Fgithub.com\u002Fmalayvuong\u002Fagent-orchestra\u002Fblob\u002Fmain\u002F.agent-orchestra\u002Fskills\u002Funity-review\u002FSKILL.md",[],[21,100,95,37,101,102,36,103,104,105,106,107,108,26,25,109,110,111,112],"unity","update","code","ui","serialization","Optimization","mobile","patterns","physics","C#","mobile optimization","object","allocation",{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":38},"01M6GXHNKTH12CGSRWDGF2H1Q9","TypeScript Review","Deep review of TypeScript code — type safety, generics patterns, strict mode compliance, type narrowing, module boundaries, and common escape hatches.","https:\u002F\u002Fgithub.com\u002Fmalayvuong\u002Fagent-orchestra\u002Fblob\u002Fmain\u002F.agent-orchestra\u002Fskills\u002Ftypescript-review\u002FSKILL.md",[],[21,120,121,102,36,122,123,124,125,107,26,25,126,127,128,129,130],"typescript","typescript review","compliance","Type Safety","Safety","common","module","type","interface","consistency","mode",{"skillNo":132,"name":133,"nameZh":6,"description":134,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":135,"categories":136,"keywords":137,"publishedAt":38},"01M6GXHH3DMZD272RVH4800C67","Test Conventions","Testing patterns and conventions for code review. Covers naming, AAA structure, boundary testing, mock vs real dependencies, and coverage expectations.","https:\u002F\u002Fgithub.com\u002Fmalayvuong\u002Fagent-orchestra\u002Fblob\u002Fmain\u002F.agent-orchestra\u002Fskills\u002Ftest-conventions\u002FSKILL.md",[],[138,139,133,140,141,21,102,142,143,144,107,145,146,147,148],"test","conventions","code review","testing","testing patterns","boundary","coverage","dependencies","structure","mock","naming",{"skillNo":150,"name":151,"nameZh":6,"description":152,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":153,"categories":154,"keywords":155,"publishedAt":38},"01M6GXHCAQSJDVNVRFFD1HJWTN","Terraform Review","Deep review of Terraform\u002FOpenTofu configuration — state management, module design, security hardening, drift prevention, and production safety patterns.","https:\u002F\u002Fgithub.com\u002Fmalayvuong\u002Fagent-orchestra\u002Fblob\u002Fmain\u002F.agent-orchestra\u002Fskills\u002Fterraform-review\u002FSKILL.md",[],[21,156,151,81,157,83,84,36,158,159,160,161,124,162,90,163,164,26,25,126],"terraform","security","cloud","aws","hardening","Production","opentofu","iac","drift",{"skillNo":166,"name":167,"nameZh":6,"description":168,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":169,"categories":170,"keywords":171,"publishedAt":38},"01M6GXH83F11CK4BQEAJPN6HDE","Swift Review","Deep review of Swift code — memory management, concurrency patterns, optionals, protocol design, SwiftUI lifecycle, and iOS platform patterns.","https:\u002F\u002Fgithub.com\u002Fmalayvuong\u002Fagent-orchestra\u002Fblob\u002Fmain\u002F.agent-orchestra\u002Fskills\u002Fswift-review\u002FSKILL.md",[],[172,21,167,81,173,37,102,174,36,175,176,177,178,179,90,26,25,180,181,182],"swift","memory","protocol","ios","concurrency","lifecycle","swiftui","uikit","xcode","apple","platform"]