mysql-optimizer

Analyze MySQL execution plans and rewrite slow queries for better performance.

Updated Apr 10, 2026
One-click install
npx skills add https://github.com/HTRTan/paperclip-skills --skill mysql-optimizer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mysql-optimizer
Source: https://github.com/HTRTan/paperclip-skills/tree/main/skills/mysql-optimizer
Command: npx skills add https://github.com/HTRTan/paperclip-skills --skill mysql-optimizer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Analyzes and optimizes MySQL queries to improve performance by diagnosing slow queries, interpreting execution plans, and proposing index design and query rewrites.

Core Features & Use Cases

  • Slow query localization and diagnosis using EXPLAIN and performance schema insights.
  • Index design and optimization to improve selectivity and reduce table scans.
  • SQL rewrite templates and best practices to avoid anti-patterns and improve performance on large datasets.

Quick Start

Provide a slow-running SQL query and its EXPLAIN plan to receive actionable optimization steps.

Frequently Asked Questions about mysql-optimizer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize slow MySQL queries using EXPLAIN execution plans?

To optimize slow MySQL queries, analyze EXPLAIN execution plans to identify bottlenecks like full table scans. Apply targeted indexing strategies and rewrite complex SQL structures to reduce latency and improve throughput.

What is the best way to tune indexes for large MySQL tables?

Index tuning for large MySQL tables involves designing indexes that improve selectivity and eliminate table scans. Analyze query structures to create composite or covering indexes that directly support your complex joins and filters.

How do I rewrite SQL queries to avoid anti-patterns on large datasets?

Rewrite SQL queries to avoid anti-patterns by replacing correlated subqueries with joins and simplifying complex logic. Apply safe SQL rewrite templates to improve performance on large datasets without altering query results.

When do I need to diagnose MySQL performance using the performance schema?

Diagnose MySQL performance using the performance schema when routine SQL reviews detect latency or throughput drops. Localize slow queries by interpreting execution plans and identifying resource-intensive operations within the database.

Can I use SQL rewrite templates for routine MySQL performance reviews?

Yes, you can use SQL rewrite templates during routine MySQL performance reviews to validate safe query structures. Apply best practices to ensure complex joins and large table queries maintain optimal latency and throughput.