Install any skill in seconds. Free to start, no credit card required.
Get Started Free →zzafergok/sql-optimization-skill
Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance.
Passed 25 of 25 test cases with the skill, and 24 of 25 without it.
1 fixed24 passed either way0 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
A test case the skill fixed. Same model, same prompt, with and without the skill.
In PostgreSQL, table `orders` has an indexed integer column `user_id`. Explain what happens to index usage when a query specifies `WHERE user_id = '12345'`.
| Checked | Without skill | With skill |
|---|---|---|
| The explanation notes that implicit type conversion prevents index usage. | Missed | Passed |
The instructions your model reads when the skill loads.
A guide to turning slow queries into fast operations through systematic optimization, correct indexing, and query plan analysis.
-- Basic explain
EXPLAIN SELECT * FROM users WHERE email = '[email protected]';
-- With actual statistics
EXPLAIN ANALYZE
SELECT * FROM users WHERE email = '[email protected]';
-- Detailed output
EXPLAIN (ANALYZE, BUFFERS, VERBOSE)
SELECT u.*, o.order_total
FROM users u
JOIN orders o ON u.id = o.user_id
WHERE u.created_at > NOW() - INTERVAL '30 days';
| Metric | Description | Status |
|---|---|---|
Seq Scan | Scans the entire table | Bad on large tables |
Index Scan | Uses an index | Good |
Index Only Scan | Index only, no table | Best |
Hash Join | Joins large datasets | Good |
Nested Loop | Joins small datasets | Good; bad at scale |
test cases passed, vs 24 / 25 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.