fai-sql-optimization-skill — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited fai-sql-optimization-skill (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.
Diagnose and fix slow queries with execution plans, indexes, and rewrites.
-- PostgreSQL
EXPLAIN (ANALYZE, BUFFERS, FORMAT TEXT) SELECT ...;
-- SQL Server
SET STATISTICS IO ON;
SET STATISTICS TIME ON;
-- Then run query, check Messages tab
-- MySQL
EXPLAIN FORMAT=TREE SELECT ...;| Signal | Problem | Fix |
|---|---|---|
| Seq Scan / Table Scan | Full table read | Add index on filter columns |
| Nested Loop (high rows) | N+1 join pattern | Consider Hash/Merge Join |
| Sort (external) | work_mem too low | Increase work_mem or add sorted index |
| Key Lookup | Non-covering index | Add INCLUDE columns |
-- Composite index for common query pattern
CREATE INDEX idx_conv_user_status ON conversations(user_id, status, created_at DESC);
-- Covering index (avoids key lookup)
CREATE INDEX idx_msg_conv_covering ON messages(conversation_id)
INCLUDE (role, content, created_at);
-- Partial index (index only relevant rows)
CREATE INDEX idx_active_conv ON conversations(user_id)
WHERE status = 'active';
-- Find unused indexes
SELECT indexrelname, idx_scan FROM pg_stat_user_indexes
WHERE idx_scan = 0 ORDER BY pg_relation_size(indexrelid) DESC;-- Bad: Correlated subquery
SELECT * FROM conversations c
WHERE (SELECT COUNT(*) FROM messages WHERE conversation_id = c.id) > 10;
-- Good: JOIN with HAVING
SELECT c.id, COUNT(m.id) FROM conversations c
JOIN messages m ON m.conversation_id = c.id
GROUP BY c.id HAVING COUNT(m.id) > 10;
-- Bad: OFFSET pagination
SELECT * FROM messages ORDER BY created_at LIMIT 20 OFFSET 50000;
-- Good: Keyset pagination
SELECT * FROM messages WHERE created_at < @last_seen
ORDER BY created_at DESC LIMIT 20;-- PostgreSQL: Update table statistics
ANALYZE conversations;
ANALYZE messages;
-- SQL Server: Update statistics
UPDATE STATISTICS conversations;
UPDATE STATISTICS messages;| Issue | Cause | Fix |
|---|---|---|
| Seq scan on indexed column | Statistics stale | Run ANALYZE |
| Slow with LIKE '%text%' | B-tree can't use leading wildcard | Use full-text search or GIN trigram |
| Join order wrong | Planner estimates off | Update statistics, consider join hints |
| Index not used | Type mismatch in WHERE | Ensure column and parameter types match |
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.