mysql-patterns
MySQL and MariaDB schema, query, indexing, transaction, replication, and connection-pool patterns for production backends.
Skill by Kilo-Org
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/kilo-org-mysql-patterns
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/mysql-patterns
What's inside
- Skill name
mysql-patterns- Description
- MySQL and MariaDB schema, query, indexing, transaction, replication, and connection-pool patterns for production backends.
- License
- Apache-2.0
- Metadata
- origin: ECC · category: data
- Instructions
- 408 lines in SKILL.md · view on GitHub
Files (2)
- LICENSE
- SKILL.md
SKILL.md (first lines)
# MySQL Patterns
Use this skill when working on MySQL or MariaDB schema design, migrations,
slow-query investigation, queue-style transactions, connection pools, or
production database configuration. Prefer exact version checks before applying a
feature-specific pattern because MySQL and MariaDB have diverged in several SQL
details.
## Activation
- Designing MySQL or MariaDB tables, indexes, and constraints
- Reviewing migrations before they run on large production tables
- Debugging slow queries, lock waits, deadlocks, or connection exhaustion
- Adding keyset pagination, upserts, full-text search, JSON columns, or queues
- Configuring application connection pools, read replicas, TLS, or slow logs
## Version Check
Start by identifying the engine and version:
```sql
SELECT VERSION();
SHOW VARIABLES LIKE 'version_comment';
```
Keep MySQL and MariaDB guidance separate when syntax differs:
- MySQL documents row aliases as the replacement for `VALUES(col)` in
`ON DUPLICATE KEY UPDATE`; `VALUES(col)` is deprecated there.
- MariaDB documents `VALUES(col)` as the supported way to reference inserted
values in `ON DUPLICATE KEY UPDATE`; use it for cross-engine compatibility.
- `SKIP LOCKED` is appropriate for queue-like work only. It skips locked rows
and can return an inconsistent view, so do not use it for general accounting
or integrity-sensitive reads.
## Schema Defaults
```sql
CREATE TABLE orders (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
account_id BIGINT UNSIGNED NOT NULL,
status VARCHAR(32) NOT NULL,
total DECIMAL(15, 2) NOT NULL,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
deleted_at DATETIME NULL,
PRIMARY KEY (id),
KEY idx_orders_account_status_created (account_id, status, created_at),
KEY idx_orders_active (account_id, deleted_at)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
```
Default choices:
| Use Case | Prefer | Avoid |
| --- | --- | --- |
| Surrogate primary keys | `BIGINT UNSIGNED AUTO_INCREMENT` | `INT` for tables that can grow beyond 2B rows |
| UUID lookup keys | `BINARY(16)` with conversion helpers | `VARCHAR(36)` primary keys on hot tables |
| Money and exact quantities | `DECIMAL(p, s)` | `FLOAT` or `DOUBLE` |
| User-facing text | `utf8mb4` tables and indexes | MySQL `utf8` / `utf8mb3` defaults |
| Application timestamps | `DATETIME` with UTC managed by the app | Assuming `DATETIME` stores time zone metadata |
| Soft deletes | `deleted_at DATETIME NULL` plus scoped indexes | Filtering soft-deleted rows without an index |
| Extensible status values | lookup table or constrained `VARCHAR` | `ENUM` when values change often |
## Indexing
Composite index order usually follows equality predicates first, then range or
sort columns:
```sql
CREATE INDEX idx_orders_account_status_created
ON orders (account_id, status, created_at);
SELECT id, total
FROM orders
WHERE account_id = ?
AND status = 'pending'
AND created_at >= ?
ORDER BY created_at DESC
LIMIT 50;
```
Use `EXPLAIN` before adding or changing an index:
```sql
EXPLAIN
SELECT id, total
FROM orders
WHERE account_id = 123 AND status = 'pending'
ORDER BY created_at DESC
LIMIT 50;
```
Signals to investigate:
| Field | Risk Signal |
| --- | --- |
| `type` | `ALL` on a large table |
| `key` | `NULL` when a selective predicate exists |
| `rows` | Very high row estimate for an interactive path |
| `Extra` | `Using temporary`, `Using filesort`, or broad `Using where` |
Avoid adding indexes blindly. Each index increases write cost, migration time,
backup size, and buffer-pool pressure.
## Query Patterns
### Upsert
Cross-engine-compatible form:
```sql
INSERT INTO user_settings (user_id, setting_key, setting_value)
VALUES (?, ?, ?)
ON DUPLICATE KEY UPDATE
setting_value = VALUES(setting_value),
updated_at = CURRENT_TIMESTAMP;
```From Kilo-Org/kilo-marketplace, Apache-2.0.
More from Kilo-Org/kilo-marketplace
- 0.795score
dynamic-tables-tutorial
Snowflake
Interactive tutorial that teaches Snowflake Dynamic Tables hands-on.
SkillAFreshness: A★ 195Claude Code +9 - 0.795score
cortex-code
Snowflake Integration Team
Routes Snowflake-related operations to Cortex Code CLI for specialized Snowflake expertise.
SkillAFreshness: A★ 195Claude Code +9 - 0.795score
dbt-analytics-engineering
dbt-labs
Builds and modifies dbt models, writes SQL transformations using ref() and source(), creates tests, and validates results with dbt show.
SkillAFreshness: A★ 195Claude Code +9 - 0.795score
database-redshift
christopher huffman
Amazon Redshift expert.
SkillAFreshness: A★ 195Claude Code +9 - 0.791score
jupyter-notebook
Kilo
Use whenever the user works with Jupyter notebooks (`.ipynb`), including creating, inspecting, editing, executing, or visualizing notebook content for…
SkillAFreshness: A★ 195Claude Code +9 - 0.791score
gcp-event-driven-architecture-review
github: Raishin
Review GCP Pub/Sub, Eventarc, Cloud Tasks, Cloud Scheduler, and Workflows designs — dead-letter topics, message ordering, idempotency, fan-out blast radius…
SkillAFreshness: A★ 195Claude Code +9 - 0.789score
dbt
dbt-labs
Skills for analytics engineering with dbt - building models, writing tests, querying the semantic layer, troubleshooting jobs, and more.
SkillAFreshness: A★ 195Claude Code +9 - 0.786score
data-investigation
Pedro / Kilo Code
A workflow for conducting rigorous, reproducible data investigations and ad-hoc analyses.
SkillAFreshness: A★ 195Claude Code +9 - 0.786score
apache-arrow
terminal-skills
Expert guidance for Apache Arrow, the cross-language columnar memory format for analytics workloads.
SkillAFreshness: A★ 195Claude Code +9 - 0.786score
dagster
terminal-skills
Dagster is a data pipeline orchestrator built around the concept of software-defined assets.
SkillAFreshness: A★ 195Claude Code +9 - 0.786score
cassandra
terminal-skills
Apache Cassandra is a distributed NoSQL database designed for high availability and linear scalability.
SkillAFreshness: A★ 195Claude Code +9 - 0.786score
prefect
terminal-skills
Prefect is a modern workflow orchestration framework for Python data pipelines.
SkillAFreshness: A★ 195Claude Code +9
Compare and alternatives
Featured in
Signals
- Stars
- 195
- Forks
- 328
- Open issues
- 18
- Last commit (this folder)
- Jun 24, 2026 (4 months ago)
- Last release
- Sep 28, 2026 (29 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Apache-2.0
- Repository
- github.com/Kilo-Org/kilo-marketplace
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from Kilo-Org
- 0.661score
angular-tooling
Kilo-Org
Use Angular CLI and development tools effectively in Angular v20+ projects.
SkillAFreshness: A★ 195Claude Code +9 - 0.661score
angular-http
Kilo-Org
Implement HTTP data fetching in Angular v20+ using resource(), httpResource(), and HttpClient.
SkillAFreshness: A★ 195Claude Code +9 - 0.661score
elasticsearch-file-ingest
Kilo-Org
Ingest and transform data files (CSV/JSON/Parquet/Arrow IPC) into Elasticsearch with stream processing and custom transforms.
SkillAFreshness: A★ 195Claude Code +9 - 0.661score
senior-data-engineer
Kilo-Org
Data engineering skill for building scalable data pipelines, ETL/ELT systems, and data infrastructure.
SkillAFreshness: A★ 195Claude Code +9 - 0.661score
sql-server-table-reconciliation
Kilo-Org
Use when: comparing SQL Server tables across instances, data migration validation, ETL verification, row mismatch detection, schema drift, reconciliation…
SkillAFreshness: A★ 195Claude Code +9 - 0.661score
dataset-transformation
Kilo-Org
Generates code that transforms datasets between ML schemas for model training or evaluation.
SkillAFreshness: A★ 195Claude Code +9
Cite this page
mysql-patterns skill. Agent Mart. https://agentmart.dev/skills/kilo-org-mysql-patterns (last updated 2026-10-24)