Agent skill · personamanagmentlayer
mysql-expert
MySQL and MariaDB administration and development: InnoDB internals, indexing, query tuning, replication, and online schema change. Use when the user mentions MySQL, MariaDB, InnoDB, `my.cnf`, slow queries, `EXPLAIN`, binlog or replication lag, gtid, Percona or pt-online-schema-change, or when the task involves designing a MySQL schema, diagnosing lock contention, or migrating a large table without downtime.
What it needs
About 6k tokens when loaded.
What this skill does
MySQL Expert MySQL differs from PostgreSQL in ways that matter for design, not just syntax: the clustered primary key, the storage-engine boundary, and a replication model built on the binary log. Core Concepts InnoDB Is the Database Everything below assumes InnoDB. Rows are stored inside the primary key index — the table is the primary key B-tree. Three consequences drive most design decisions: 1. The primary key is present in every secondary index, so a wide primary key inflates every index on the table. 2. A secondary index lookup costs two traversals: the index, then the primary key. Unless the index covers the query. 3. Inserts in primary key order are cheap; random primary keys cause page splits and fragmentation. This is why a BIGINT AUTOINCREMENT or a time-ordered UUID (UUIDv7) beats a random UUIDv4 primary key by a wide margin on large tables. Character Sets Use utf8mb4 and nothing else. MySQL's utf8 is a three-byte subset that cannot store emoji or some CJK characters, and it fails by truncating or erroring at insert time. Collation determines comparison and sorting. utf8mb40900aici is accent-insensitive and case-insensitive; use utf8mb40900ascs or bin when you need exact matching, for example on tokens or hashes. Isolation and Locking The default is REPEATABLE READ, which is stricter than PostgreSQL's default and uses gap locks that surprise people migrating across. READ COMMITTED reduces gap locking and deadlocks for typical OLTP workloads. Change it deliberately and test — it also changes replication semantics for statement-based binlog formats. Schema Design Decisions worth defending: Surrogate BIGINT primary key, with the externally visible identifier as a separate unique column. Keeps the clustered index narrow and sequential. BINARY(16) for UUIDs, not CHAR(36): a quarter of the size, and it propagates into every secondary index. Money as integer minor units. DECIMAL is acceptable; FLOAT and DOUBLE are not, ever. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills personamanagmentlayer/mysql-expert