MySQL Design and Usage Assistant
Paste the following prompt into your AI chat to install this skill:
Please follow https://skillhub.cn/install/skillhub.md to install @user_3651d062/mysql-design-adodo.
About this skill
Problem
When designing MySQL schemas and optimizing queries, common issues include inconsistent naming, poor primary-key and money-type choices, missing unique constraints, unclear VARCHAR prefix length, weak composite-index ordering, limited covering-index usage, excessive JOINs, deep-pagination pressure, charset/collation mismatches, and weak checks for sharding or migration. This skill provides concrete constraints for schema design and DDL review.
How It Works
- Activation: triggered for schema design, index optimization, sharding, data migration, or requests like “how to design xxx database”.
- Baseline constraints: prefer
BIGINT UNSIGNED AUTO_INCREMENTprimary keys,create_time/update_time,is_deletedsoft deletes,DECIMAL(18,2)money,utf8mb4charset, and table/columnCOMMENTs. - Naming and types: use lowercase snake_case names,
uk_for unique indexes,idx_for regular indexes,TINYINT UNSIGNEDfor booleans, andTINYINT UNSIGNED + COMMENTfor status/enum fields. - Indexing strategy: enforce unique indexes for unique fields, prefix-length indexes for
VARCHAR, high-cardinality fields first in composite indexes, covering indexes where possible, delayed joins for deep pagination, and avoid left/full wildcard queries. - Version loading: read
references/design-spec.md,references/usage-guide.md,references/best-practices.md,references/patterns.md, andversion-*.mdas needed to check deprecations, new capabilities, and minor-version differences.
Boundaries
Useful for business schema review, CREATE TABLE drafts, slow-query index planning, sharding evaluation, and migration pre-checks. It provides design constraints and reference material, not final database operations decisions; tables beyond 5 million rows or 2GB require sharding evaluation.
Use Cases
- Review an order table draft for naming, required fields, DECIMAL amounts, and utf8mb4 charset.
- Diagnose a slow product-list query by checking index prefixes, composite order, covering indexes, and delayed joins.
- Plan user points sharding after a table crosses 5 million rows or 2GB.
- Check MySQL 8.0 upgrades against 5.7 and 8.0 version notes for deprecated features and schema impacts.
Best For
- Backend engineers building order, payment, or user services need business schemas turned into reviewable DDL.
- Database engineers troubleshooting slow queries need index-based optimization directions that can be validated.
- Application owners preparing upgrades need to check MySQL version features for schema impact.
- Architects reviewing technical designs need consistent naming, type, index, and sharding constraints.
Related Skills
Analyzes code to extract control and data flow, then outputs Markdown with Mermaid source and high-resolution PNG diagrams.
For development and programming scenarios around VSCode and TypeScript IDE.
A TypeScript-oriented Windmill Wrap development reference.
A Python-based Selenium wrapper for engineering browser automation workflows.