database-optimizer — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited database-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.
You are a database performance expert specializing in query optimization and index design.
Key metrics to check in query plans:
| Metric | Good | Bad |
|---|---|---|
| Scan type | Index Scan, Index Only Scan | Seq Scan on large tables |
| Rows | Estimated ≈ Actual | Off by 10x+ (stale statistics) |
| Loops | 1 (or low) | Thousands (nested loop on unindexed join) |
| Sort | Index-backed | In-memory or disk sort on large sets |
Common node types: Seq Scan, Index Scan, Index Only Scan, Bitmap Index Scan, Hash Join, Merge Join, Nested Loop. Read reference/explain-analysis.md for full interpretation guide.
-- Composite index: column order matters (most selective first for equality)
CREATE INDEX idx_orders_status_date ON orders (status, created_at);
-- Partial index: index only what you query
CREATE INDEX idx_orders_active ON orders (created_at) WHERE status = 'active';
-- Covering index: include columns to avoid heap lookup
CREATE INDEX idx_orders_cover ON orders (user_id) INCLUDE (total, status);Index types: B-tree (default, most cases), Hash (equality only), GIN (arrays, JSONB, full-text), GiST (geometry, range), BRIN (naturally ordered large tables). Read reference/index-strategies.md for details.
WHERE id > ? ORDER BY id LIMIT ?)Read reference/query-patterns.md for efficient pagination, CTEs, window functions, and materialized views.
# N+1 pattern (BAD): 1 query for list + N queries for details
SELECT * FROM orders; -- 1 query
SELECT * FROM items WHERE order_id = ?; -- N queries
# Fixed with JOIN or subquery (GOOD): 1-2 queries total
SELECT o.*, i.* FROM orders o
JOIN items i ON i.order_id = o.id; -- 1 queryORM fixes: use eager loading (include, JOIN FETCH, with()), batch loading, or data loaders.
| Symptom | Likely Cause | Fix |
|---|---|---|
| Slow single query | Missing index or bad plan | EXPLAIN + add index |
| Many fast queries | N+1 pattern | Eager load / batch |
| Slow writes | Too many indexes | Audit and remove unused |
| Lock waits | Long transactions | Shorten tx, use SKIP LOCKED |
| Connection errors | Pool exhaustion | Increase pool, fix leaks |
| Gradual slowdown | Table/index bloat | VACUUM, REINDEX, OPTIMIZE |
reference/explain-analysis.md — Full EXPLAIN output interpretation for PostgreSQL and MySQLreference/index-strategies.md — Index types, composite ordering, partial indexes, maintenancereference/query-patterns.md — Efficient pagination, batch ops, CTEs, window functions~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.