Skip to content
Back to skills

Mysql Tuning

ASecurity

Tune MySQL/InnoDB performance through composite index design, EXPLAIN plans, lock reduction, and safe online DDL

  • 5 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 30, 2026
developmentgosqlperformance

Security analysis

A100/100

Scanned November 30, 2026

npx -y skills add AdityaaaTiwari/ANVIL --skill mysql-tuning --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Mysql Tuning?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Mysql Tuning
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/adityaaatiwari-mysql-tuning-anvil/badge)](https://www.skillsdirectory.com/skills/adityaaatiwari-mysql-tuning-anvil)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: mysql-tuning
description: Tune MySQL/InnoDB performance through composite index design, EXPLAIN plans, lock reduction, and safe online DDL
---

<!-- Generated by `anvil plugin build` from catalog/. Edit the catalog, not this file. -->

# MySQL tuning

Use when optimizing slow MySQL queries, reducing InnoDB lock contention, or altering large production tables.

## Indexes and query plans
- Order composite index columns for equality predicates first, range columns next, and sort/covering columns last (`leftmost prefix` rule).
- Never wrap indexed columns in functions (`WHERE DATE(created_at) = ...`); rewrite filters as sargable range bounds (`>=` and `<`).
- Inspect `EXPLAIN FORMAT=TREE` / `EXPLAIN ANALYZE` to check `type` (`const`/`ref`/`range` vs full `ALL`) and estimated vs actual rows.

## Locks and schema changes
- Keep InnoDB transactions small and ordered consistently to minimize gap-lock and deadlock rates (`SHOW ENGINE INNODB STATUS`).
- Use `ALGORITHM=INPLACE, LOCK=NONE` (or online tools like `gh-ost` / `pt-online-schema-change` on huge tables) to avoid metadata/write stalls.
- Configure `innodb_buffer_pool_size` appropriately and set `sql_mode` strictly (`STRICT_TRANS_TABLES`).

## Verify
Run `EXPLAIN ANALYZE` on representative data volumes and confirm p95 query latency and lock-wait metrics drop under load.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.