SQL Query Optimizer — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited SQL Query Optimizer (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Make queries fast by understanding the plan, not by guessing. The costly mistake this skill prevents is the shotgun index: adding indexes on instinct, which slows every write and bloats storage while the actual cost driver - a non-sargable predicate, a mis-ordered composite, an N+1 in the ORM - survives untouched.
Diagnosis strictly precedes any fix, because the right fix depends on which cost driver the plan reveals.
Collect (label guesses as guesses):
EXPLAIN ANALYZE output (or EXPLAIN if production-unsafe to execute; note that estimates only).\d table or equivalent).Scan for these signals, in rough order of frequency:
loops=N large) over a non-trivial row count - join order or missing join index.Sort Method: external merge) - the sort exceeds work_mem; fix with an index providing the order, or raise work_mem only if the sort is genuinely necessary.Rows Removed by Filter large) - the index does not cover the real predicate.Symptoms: one query is fast in isolation but the endpoint is slow; the DB log shows the same query shape hundreds of times per request with only the ID changing; latency scales with result count. If present, the fix is in the application (batch/JOIN/preload), not in this query - route to n-plus-one-hunter and stop tuning a query that should not run N times.
WHERE date(created_at) = '...' as WHERE created_at >= '...' AND created_at < '...' + 1 day. Same for LOWER(email) = ... (use a functional index or citext) and leading-wildcard LIKE.WHERE id > last_seen ORDER BY id LIMIT n) - OFFSET still reads and discards every skipped row.Re-run EXPLAIN ANALYZE after the change. Claim a speedup only with before/after plan evidence. State the write-side cost of any new index: each index adds work to every INSERT/UPDATE on the table - on a write-heavy table (thousands of writes/minute), an index must earn its keep, and 5+ indexes on such a table deserves scrutiny.
Before - 4.2 s on a 6M-row orders table:
SELECT * FROM orders
WHERE date(created_at) = '2026-06-01' AND status = 'shipped'
ORDER BY total DESC LIMIT 20;
-- Plan: Seq Scan on orders (rows=6,012,340), Filter removes 99.9%,
-- Sort Method: external merge Disk: 214MBReasoning: date(created_at) defeats any index on created_at (non-sargable), so the planner seq-scans all 6M rows, then sorts the survivors on disk. Fix the predicate to a range, then give the planner one composite index serving the equality filter, the range, and the sort.
After - 8 ms:
CREATE INDEX idx_orders_status_created_total
ON orders (status, created_at, total DESC);
SELECT id, customer_id, total, created_at FROM orders
WHERE status = 'shipped'
AND created_at >= '2026-06-01' AND created_at < '2026-06-02'
ORDER BY total DESC LIMIT 20;
-- Plan: Index Scan using idx_orders_status_created_total (rows=20)Equality column (status) leads, range (created_at) next, sort key last; the projection drops SELECT *. Write cost: one more index maintained per order write - acceptable unless orders sustains very high write rates.
Produce: the rewritten query, the index DDL, a one-or-two-sentence expected plan change, the before/after EXPLAIN evidence (or a note that verification is pending), and the write-side cost statement for each new index.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.