Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries. Use when debugging slow queries, designing database schemas, or optimizing application performance.
76
66%
Does it follow best practices?
Impact
93%
0.98xAverage score across 3 eval scenarios
Passed
No known issues
Optimize this skill with Tessl
npx tessl skill review --optimize ./tests/ext_conformance/artifacts/agents-wshobson/developer-essentials/skills/sql-optimization-patterns/SKILL.mdN+1 elimination and subquery optimization
No loop queries
100%
100%
Single aggregate query
100%
100%
No correlated subquery
100%
100%
No SELECT *
100%
100%
JOIN-based aggregation
100%
100%
Filter before aggregation
100%
100%
Correct aggregation
100%
100%
CTE or subquery clarity
0%
0%
Notes explain N+1
100%
100%
Notes explain fix
100%
100%
Index design and selection strategy
GIN full-text index
100%
100%
GIN JSONB index
100%
100%
Expression index for email
100%
100%
Partial index for published status
100%
100%
Composite index column order
100%
100%
Cursor pagination index
70%
70%
Cursor-based query provided
100%
100%
No leading wildcard LIKE
100%
100%
Index type rationale
100%
100%
Selective indexing awareness
50%
40%
Performance audit and advanced optimization
pg_stat_statements query
100%
100%
Missing index detection
80%
100%
Unused index detection
100%
100%
Materialized view creation
100%
100%
Concurrent materialized refresh
100%
100%
Batch UPDATE not loop
100%
100%
Temp table for large batch
100%
100%
pg_class approximate count
100%
100%
VACUUM ANALYZE maintenance
100%
100%
Materialized view index
100%
100%
47823e3
Table of Contents
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.