Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Optimize SQL and NoSQL databases with schema design, query performance tuning, and indexing strategies.
.claude/skills/williamzujkowski-database-optimization-analyzer/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 101% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 77% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 89% | 0% |
| case-08 | ✓→✓ | = Same ✓ | 102% | 0% |
| case-05 | ✓→✓ | = Same ✓ | 104% | 0% |
Use this skill when:
Do not use for:
NOW_ET = 2025-10-25T22:10:45-04:00 (NIST/time.gov semantics)Scope: Quick wins for common query anti-patterns without deep execution plan analysis.
Steps:
Abort Conditions:
Scope: Detailed execution plan analysis, schema review, and database-specific optimizations.
Steps:
Decision Rules:
Scope: Multi-query optimization, workload analysis, and migration recommendations.
Steps:
Abort Conditions:
Schema (JSON):
json{ "analysis_timestamp": "ISO-8601 datetime", "database_type": "string (postgresql|mysql|mongodb|redis|other)", "query_analyzed": "string", "findings": [ { "type": "string (index|query_rewrite|schema_change|configuration)", "severity": "string (high|medium|low)", "description": "string", "recommendation": "string", "implementation_code": "string (DDL or config)", "estimated_impact": "string (e.g., '80% reduction in rows scanned')" } ], "index_recommendations": [ { "table_or_collection": "string", "index_definition": "string (CREATE INDEX ... or db.collection.createIndex(...))", "rationale": "string", "estimated_size_mb": "number (optional)" } ], "query_rewrites": [ { "original_query": "string", "optimized_query": "string", "improvement_rationale": "string" } ], "next_steps": ["string array of actionable items"], "sources_consulted": ["string array of URLs with access dates"] }
Required Fields:
analysis_timestamp, database_type, findings (must have ≥1 finding or explain why no issues found)sources_consulted must include 2-4 authoritative sourcesExample: PostgreSQL Slow Query Optimization
Input:
json{ "database_type": "postgresql", "query": "SELECT * FROM orders WHERE customer_id = 12345 AND status = 'pending' ORDER BY created_at DESC", "performance_metrics": { "execution_time_ms": 2300, "rows_scanned": 450000, "rows_returned": 15 } }
Output (T1):
json{ "findings": [ {"type": "query_rewrite", "severity": "medium", "description": "SELECT * loads unnecessary columns", "recommendation": "Use explicit column list"}, {"type": "index", "severity": "high", "description": "Seq Scan on orders (450k rows scanned for 15 returned)", "recommendation": "Create composite index on (customer_id, status, created_at)"} ], "index_recommendations": [ {"table_or_collection": "orders", "index_definition": "CREATE INDEX idx_orders_customer_status_created ON orders(customer_id, status, created_at DESC);", "rationale": "Covers WHERE predicates and ORDER BY"} ] }
PostgreSQL:
MySQL:
MongoDB:
Redis:
General:
resources/ directory for query templates and index strategy guides| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 11,453 | 10,344 | -10% | 1 | 1 | 0% | 3,051 | 6,126 | +101% | 0 | 0 | — |
case-02 | fail→pass | 16,315 | 12,455 | -24% | 1 | 1 | 0% | 3,694 | 6,522 | +77% | 0 | 0 | — |
case-03 | fail→pass | 13,514 | 11,868 | -12% | 1 | 1 | 0% | 3,477 | 6,580 | +89% | 0 | 0 | — |
case-08 | pass→pass | 13,631 | 12,030 | -12% | 1 | 1 | 0% | 3,052 | 6,158 | +102% | 0 | 0 | — |
case-04 | fail→fail | 12,195 | 12,186 | -0% | 1 | 1 | 0% | 2,751 | 6,415 | +133% | 0 | 0 | — |
case-05 | pass→pass | 12,669 | 9,370 | -26% | 1 | 1 | 0% | 2,737 | 5,580 | +104% | 0 | 0 | — |
case-06 | pass→pass | 9,744 | 10,739 | +10% | 1 | 1 | 0% | 2,048 | 5,841 | +185% | 0 | 0 | — |
case-07 | pass→pass | 12,501 | 11,668 | -7% | 1 | 1 | 0% | 2,736 | 6,219 | +127% | 0 | 0 | — |
case-09 | pass→pass | 9,264 | 9,401 | +1% | 1 | 1 | 0% | 1,947 | 5,469 | +181% | 0 | 0 | — |
case-10 | pass→pass | 17,011 | 12,041 | -29% | 1 | 1 | 0% | 3,461 | 6,241 | +80% | 0 | 0 | — |
case-11 | pass→pass | 12,263 | 10,724 | -13% | 1 | 1 | 0% | 2,685 | 5,923 | +121% | 0 | 0 | — |
case-12 | pass→pass | 13,091 | 10,029 | -23% | 1 | 1 | 0% | 2,783 | 5,774 | +107% | 0 | 0 | — |
case-13 | pass→pass | 10,741 | 10,257 | -5% | 1 | 1 | 0% | 2,340 | 5,823 | +149% | 0 | 0 | — |
case-14 | pass→pass | 10,444 | 9,819 | -6% | 1 | 1 | 0% | 2,367 | 5,804 | +145% | 0 | 0 | — |
case-15 | pass→pass | 8,608 | 7,726 | -10% | 1 | 1 | 0% | 1,916 | 5,228 | +173% | 0 | 0 | — |
case-16 | pass→pass | 16,795 | 9,496 | -43% | 1 | 1 | 0% | 3,663 | 5,817 | +59% | 0 | 0 | — |
case-17 | pass→pass | 16,804 | 7,992 | -52% | 1 | 1 | 0% | 2,876 | 5,173 | +80% | 0 | 0 | — |
case-18 | pass→pass | 10,992 | 9,059 | -18% | 1 | 1 | 0% | 2,269 | 5,671 | +150% | 0 | 0 | — |
case-19 | pass→pass | 9,525 | 9,026 | -5% | 1 | 1 | 0% | 1,910 | 5,239 | +174% | 0 | 0 | — |
case-20 | pass→pass | 13,175 | 9,601 | -27% | 1 | 1 | 0% | 2,935 | 5,577 | +90% | 0 | 0 | — |
case-21 | fail→fail | 25,034 | 17,858 | -29% | 1 | 1 | 0% | 4,959 | 7,155 | +44% | 0 | 0 | — |
case-22 | fail→fail | 13,949 | 14,054 | +1% | 1 | 1 | 0% | 3,095 | 6,521 | +111% | 0 | 0 | — |
case-23 | fail→fail | 16,623 | 17,352 | +4% | 1 | 1 | 0% | 3,588 | 7,395 | +106% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +13 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.