mysql-perf-tuning — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited mysql-perf-tuning (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.
A systematic approach to MySQL performance tuning using the mysqltuner_mcp MCP server, which provides 39 diagnostic tools for analyzing and optimizing MySQL databases.
This skill requires the mysqltuner_mcp MCP server to be connected. The server provides tools that query MySQL's performance_schema, information_schema, sys schema, and server status variables.
Before starting any tuning work, verify the MCP connection is active by calling one of the tools (e.g., check_database_health).
User's problem → What type of issue?
│
├─ "Database is slow" (general) ──────────→ Full Performance Audit
│ Start: check_database_health → get_slow_queries → analyze_wait_events
│ Reference: [tuning-workflow.md] Phase 2-6
│
├─ Specific slow query ────────────────────→ Query Optimization
│ Start: analyze_query (EXPLAIN) → get_index_recommendations
│ Reference: [tuning-workflow.md] "Query Optimization Workflow"
│
├─ "Too many connections" / timeouts ──────→ Connection Analysis
│ Start: analyze_connections → calculate_memory_usage
│ Reference: [common-problems.md] "Too Many Connections"
│
├─ Lock waits / deadlocks ─────────────────→ Lock Diagnosis
│ Start: analyze_table_locks → analyze_innodb_transactions
│ Reference: [common-problems.md] "Lock Contention"
│
├─ Replication lag ────────────────────────→ Replication Analysis
│ Start: get_replication_status → get_slow_queries
│ Reference: [common-problems.md] "Replication Lag"
│
├─ Memory / OOM issues ────────────────────→ Memory Analysis
│ Start: calculate_memory_usage → analyze_buffer_pool
│ Reference: [configuration-recommendations.md] "Memory Settings"
│
├─ Disk space issues ──────────────────────→ Storage Analysis
│ Start: profile_schema_sizes → get_fragmented_tables → analyze_binlog
│ Reference: [common-problems.md] "Disk Space"
│
├─ Configuration review ───────────────────→ Settings Audit
│ Start: review_settings → review_optimizer_config
│ Reference: [configuration-recommendations.md]
│
├─ Index optimization ─────────────────────→ Index Review
│ Start: find_unused_indexes → get_index_recommendations
│ Reference: [tuning-workflow.md] "Index Optimization"
│
├─ Security audit ─────────────────────────→ Security Analysis
│ Start: analyze_security → analyze_user_privileges
│
├─ Health check / monitoring ──────────────→ Quick Health
│ Start: check_database_health → get_global_status_snapshot
│
├─ Table maintenance / fragmentation ─────→ Maintenance
│ Start: get_fragmented_tables → profile_schema_sizes → analyze_auto_increment
│ Reference: [common-problems.md] "Table Fragmentation", [advanced-diagnostics.md] "Table Maintenance"
│
├─ DDL stuck / metadata lock ─────────────→ Metadata Lock Diagnosis
│ Start: analyze_table_locks → get_active_queries → analyze_innodb_transactions
│ Reference: [common-problems.md] "Metadata Lock Blocking DDL"
│
└─ Advanced / beyond MCP tools ───────────→ Raw SQL Diagnosis
Reference: [tsg-diagnostic-queries.md], [advanced-diagnostics.md]
Covers: optimizer trace, errant GTIDs, DEFINER audits, delta comparisonStep 1: Check prerequisites
Tool: check_perf_schema_configMany tools depend on performance_schema. If it is OFF, warn the user that diagnostic depth will be limited and recommend enabling it.
Step 2: Get the health score
Tool: check_database_healthThis returns a score from 0-100:
The health score tells you how urgently to act and helps prioritize the analysis.
The tuning process follows a priority order based on impact-to-effort ratio. Always work top-down unless the user has a specific problem to solve.
Bad queries are the #1 cause of MySQL performance problems. A single unindexed query can bring down an entire server.
Tools (in order):
1. get_slow_queries → Find the costliest queries
2. get_statements_with_full_scans → Find queries missing indexes
3. analyze_query (per query) → Get EXPLAIN plan details
4. get_index_recommendations → Generate CREATE INDEX statementsFor detailed methodology, read reference/tuning-workflow.md → "Query Optimization Workflow".
Remove waste before adding new indexes. Every unnecessary index slows down writes.
Tools:
1. find_unused_indexes → Find zero-read indexes to DROP
2. get_index_recommendations → Suggest missing indexes to CREATE
3. get_index_stats → Verify index selectivityTools:
1. analyze_buffer_pool → Check hit ratio (target: >99% for OLTP)
2. calculate_memory_usage → Verify memory allocation vs physical RAM
3. review_settings (category: memory/innodb) → Configuration reviewTools:
1. analyze_connections → Connection state breakdown
2. analyze_table_locks → Lock contention patterns
3. analyze_temp_tables → Temp table disk spill analysisTools:
1. profile_schema_sizes → Data distribution
2. get_fragmented_tables → Space reclamation opportunities
3. analyze_auto_increment → Overflow risk detection
4. analyze_binlog → Binlog disk usageWhen reporting findings to the user, follow this structure:
SET GLOBAL or my.cnf valuesCREATE INDEX and DROP INDEX DDLFor configuration recommendations with specific values, read reference/configuration-recommendations.md.
The MCP server provides pre-built prompts for common scenarios. Suggest these to the user when appropriate:
| Prompt | When to Use |
|---|---|
performance_audit | Comprehensive full-server audit |
optimize_slow_query | Analyzing a specific slow query |
health_check | Quick overall health assessment |
index_review | Schema-wide index optimization |
connection_tuning | Connection pool and timeout issues |
innodb_deep_dive | Buffer pool, redo log, transaction tuning |
lock_contention_diagnosis | Deadlocks, lock waits, metadata locks |
capacity_planning | Growth projections and resource sizing |
Load these as needed for deeper guidance:
performance_schema is enabled before relying on diagnostic toolsCREATE INDEX DDL)The 39 MCP tools cover live performance diagnostics comprehensively. For these scenarios, use raw SQL from the reference files:
| Scenario | Reference File | Key Technique |
|---|---|---|
| EXPLAIN doesn't explain bad plan choice | advanced-diagnostics.md | Optimizer trace |
| Need to compare metrics over time | tsg-diagnostic-queries.md | Global status delta comparison |
| Table maintenance after bulk operations | advanced-diagnostics.md | ANALYZE / OPTIMIZE / CHECK TABLE |
| DDL stuck on metadata lock | common-problems.md | Metadata lock diagnosis |
| Security audit of DEFINERs / routines | advanced-diagnostics.md | DEFINER / SQL SECURITY audit |
| Replication errant GTIDs | advanced-diagnostics.md | GTID_SUBTRACT comparison |
| Parallel replication not parallelizing | tsg-diagnostic-queries.md | Worker utilization + missing PK check |
| InnoDB purge lag / undo growth | common-problems.md | Purge lag diagnosis |
| InnoDB mutex contention | advanced-diagnostics.md | SHOW ENGINE INNODB MUTEX |
| Histogram statistics for better plans | advanced-diagnostics.md | ANALYZE TABLE ... UPDATE HISTOGRAM |
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.