← ClaudeAtlas

public-mysql-expert-baselisted

MySQL/InnoDB 知识基座。覆盖 schema 设计、索引策略、查询调优、事务与锁、分区、运维操作。供 devlab-middleware-expert 通过 extends 继承。
seed-forge/harness-ai-kit · ★ 22 · API & Backend · score 74
Install: claude install-skill seed-forge/harness-ai-kit
# MySQL/InnoDB Knowledge Base Use this skill to make safe, measurable MySQL/InnoDB changes. > **Source**: Adapted from [planetscale/database-skills](https://github.com/planetscale/database-skills) (MySQL skill). PlanetScale-specific content removed; only general MySQL/InnoDB knowledge retained. ## Workflow 1. Define workload and constraints (read/write mix, latency target, data volume, MySQL version). 2. Read only the relevant reference files linked in each section below. 3. Propose the smallest change that can solve the problem, including trade-offs. 4. Validate with evidence (`EXPLAIN`, `EXPLAIN ANALYZE`, lock/connection metrics). 5. For production changes, include rollback and post-deploy verification. ## Schema Design - Prefer narrow, monotonic PKs (`BIGINT UNSIGNED AUTO_INCREMENT`) for write-heavy OLTP tables. - Avoid random UUID values as clustered PKs; if external IDs are required, keep UUID in a secondary unique column. - Always `utf8mb4` / `utf8mb4_0900_ai_ci`. Prefer `NOT NULL`, `DATETIME` over `TIMESTAMP`. - Lookup tables over `ENUM`. Normalize to 3NF; denormalize only for measured hot paths. References: - [primary-keys](references/REFERENCE-PRIMARY-KEYS.md) - [data-types](references/REFERENCE-DATA-TYPES.md) - [character-sets](references/REFERENCE-CHARACTER-SETS.md) - [json-column-patterns](references/REFERENCE-JSON-COLUMN-PATTERNS.md) ## Indexing - Composite order: equality first, then range/sort (leftmost prefix rule). - Range predicates stop index usage fo