mysql
Skill15 starsChanged 42 days agoMITView on GitHub
Expert MySQL relational database assistance covering InnoDB engine, query optimization with EXPLAIN, transactions, and replication. Use when designing relational schemas, tuning SQL queries, or scaling MySQL.
10 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- ericwood8/skillstheir own version, first seen Nov 1, 2026
- liushikuan63/Qoder-Optimizationedited, first seen Nov 1, 2026
- BaratovSokhibjon/skillstheir own version, first seen Oct 25, 2026
- davidanthonyn/claude-skillstheir own version, first seen Oct 20, 2026
- fworks-tech/agenthoodtheir own version, first seen Sep 28, 2026
- sanjay3290/ai-skillstheir own version, first seen Jul 6, 2026
Other versions10 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- liushikuan63/Qoder-Optimization★ 222% same
Wrote their own version · 9
- planetscale/database-skills★ 711same name
- sanjay3290/ai-skills★ 452same name
- nikosdion/devskills★ 4same name
- fworks-tech/agenthood★ 3same name
- BaratovSokhibjon/skills★ 1same name
- ericwood8/skills★ 1same name
- davidanthonyn/claude-skills★ 0same name
- muxammadmamajonov/dot-claude★ 0same name
- sudarshanpjadhav/finggu-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository350 other files it gives its agents.
- airflowSkill
- catboostSkill
- claudeSkill
- comfyuiSkill
- cursor-aiSkill
- dalleSkill
- daskSkill
- dbtSkill
- deepseekSkill
- fastaiSkill
- geminiSkill
- github-copilotSkill
- huggingfaceSkill
- jaxSkill
- jupyterSkill
- kerasSkill
- langchainSkill
- lightgbmSkill
- llamaindexSkill
- llamaSkill
- matplotlibSkill
- midjourneySkill
- mistralSkill
- mlflowSkill
- nltkSkill
- numpySkill
- ollamaSkill
- openai-gptSkill
- opencvSkill
- pandasSkill
- perplexitySkill
- plotlySkill
- polarsSkill
- pytorchSkill
- raySkill
- scikit-learnSkill
- seabornSkill
- spacySkill
- sparkSkill
- stable-diffusionSkill
- tensorflowSkill
- vaexSkill
- weights-biasesSkill
- whisperSkill
- xgboostSkill
- api-gatewaySkill
- clean-architectureSkill
- cqrsSkill
- domain-driven-designSkill
- event-drivenSkill
- event-sourcingSkill
- graphqlSkill
- grpcSkill
- hexagonalSkill
- microservicesSkill
- modular-monolithSkill
- monolithSkill
- rest-apiSkill
- sagaSkill
- serverlessSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 2 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 9 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 75
Use keyset seek pagination utilizing indexed primary key comparisons:
- Very specific: line 92
Use EXPLAIN FORMAT=JSON: Inspect query execution plans to identify temporary tables, filesorts, and full table scans.
- Distinctive: line 97
Use random UUIDv4 as primary keys: Random UUIDs cause index page fragmentation and severe disk I/O thrashing during inserts.
- Very specific: line 98
Use SELECT * in production code: Query only needed columns to leverage covering indexes.
“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
MySQL
MySQL is a widely used relational database management system (RDBMS). It is the "M" in the LAMP stack and powers huge platforms like Facebook and WordPress.
When to Use
- Web Application Relational Backbone: The world's most popular open-source relational database powering WordPress, Rails, and web backends.
- ACID Transaction Guarantees: Processing financial transactions, order checkouts, and inventory balances reliably with InnoDB.
- Read-Heavy Web Applications: Scaling reads horizontally using primary-replica asynchronous and semi-synchronous replication topologies.
- Modern Document Store (JSON Columns): Indexing and querying semi-structured JSON documents alongside relational SQL tables.
Quick Start
-- Upsert (Insert or Update)
INSERT INTO users (id, name) VALUES (1, 'Jane')
ON DUPLICATE KEY UPDATE name = 'Jane';Core Concepts
InnoDB Storage Engine & B+Tree Clustered Indexes
InnoDB stores table rows clustered physically on disk by primary key, providing instant primary key lookups:
CREATE TABLE commerce.orders (
order_id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
user_id INT UNSIGNED NOT NULL,
total_amount DECIMAL(12, 2) NOT NULL,
status ENUM('PENDING', 'PAID', 'SHIPPED', 'CANCELLED') DEFAULT 'PENDING',
details JSON,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
INDEX idx_user_status (user_id, status)
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;JSON Functional Indexes
Creates virtual indexed columns over specific JSON paths to accelerate document queries:
-- Create functional index on JSON path
ALTER TABLE commerce.orders
ADD INDEX idx_customer_tier ((CAST(details->>'$.customer.tier' AS CHAR(20))));
-- Optimized index query
SELECT * FROM commerce.orders
WHERE details->>'$.customer.tier' = 'Platinum';Semi-Synchronous Replication Topology
Guarantees that at least one read replica has received transaction events before returning success:
[ Primary Master ] ──Replication Event──→ [ Replica 1 (Awaits ACK) ] ──ACK──→ [ Primary Commits ]
│
▼
[ Replica 2 (Async) ]Common Patterns
Keyset Pagination (Seek Method)
Problem: Traditional OFFSET 1000000 LIMIT 20 scans and discards 1 million rows, resulting in extreme query latency.
Solution: Use keyset seek pagination utilizing indexed primary key comparisons:
-- Fast seek pagination regardless of page depth
SELECT id, title, price, created_at
FROM products
WHERE (created_at, id) < ('2025-03-01 10:00:00', 94821)
ORDER BY created_at DESC, id DESC
LIMIT 20;Best Practices
Do:
- Choose Compact Primary Keys: Use
BIGINT UNSIGNED AUTO_INCREMENTor ordered UUIDs (v7); secondary indexes store the primary key. - Size
innodb_buffer_pool_sizeAppropriately: Allocate 70-80% of total physical RAM to the InnoDB buffer pool on dedicated servers. - Use
EXPLAIN FORMAT=JSON: Inspect query execution plans to identify temporary tables, filesorts, and full table scans. - Enable Binary Logging with Row Format: Set
binlog_format = ROWfor safe, deterministic replication and point-in-time recovery.
Don't:
- Use random UUIDv4 as primary keys: Random UUIDs cause index page fragmentation and severe disk I/O thrashing during inserts.
- Use
SELECT *in production code: Query only needed columns to leverage covering indexes. - Store unstructured text without character sets: Default to
utf8mb4withutf8mb4_0900_ai_cicollation for full Unicode support.
Troubleshooting
| Error | Cause | Solution |
ERROR 1205 (HY000): Lock wait timeout exceeded | Long-running transaction holding row locks requested by another query. | Kill blocking transaction (SHOW PROCESSLIST) and keep transactions short. |
ERROR 1040: Too many connections | Connection pool exhaustion exceeding max_connections. | Increase max_connections or place ProxySQL connection pooler in front. |
Using filesort; Using temporary in EXPLAIN | Query cannot use index to satisfy ORDER BY or GROUP BY. | Add composite index that includes both WHERE filter columns and ORDER BY columns in order. |
References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

