Install any skill in seconds. Free to start, no credit card required.
Get Started Free →microck/sql-optimization-patterns
Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries.
Passed 23 of 24 test cases with the skill, and 22 of 24 without it.
1 fixed22 passed either way1 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.
We want to inspect the worst-performing queries across our entire PostgreSQL database ordered by mean execution time. Which PostgreSQL system view or extension table provides query call statistics and execution durations?
| Checked | Without skill | With skill |
|---|---|---|
| queries pg_stat_statements view | Passed | Passed |
| orders results by mean_time DESC | Missed | Passed |
The instructions your model reads when the skill loads.
Transform slow database queries into lightning-fast operations through systematic optimization, proper indexing, and query plan analysis.
Understanding EXPLAIN output is fundamental to optimization.
PostgreSQL EXPLAIN:
-- Basic explain
EXPLAIN SELECT * FROM users WHERE email = '[email protected]';
-- With actual execution stats
EXPLAIN ANALYZE
SELECT * FROM users WHERE email = '[email protected]';
-- Verbose output with more details
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';
Key Metrics to Watch:
test cases passed, vs 22 / 24 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.