mysql-problem-solverlisted
Install: claude install-skill pekral/cursor-rules
# MySQL Problem Solver
## Purpose
Investigate real MySQL performance or query design problems in existing applications.
Focus on:
- the actual query
- real schema and index usage
- EXPLAIN-based diagnosis when possible
- safe, justified optimizations
## Constraints
- Apply @rules/sql.mdc
- If the current project uses Laravel, also apply `@rules/laravel/laravel.mdc`, `@rules/laravel/architecture.mdc`, `@rules/laravel/filament.mdc`, and `@rules/laravel/livewire.mdc`
- Be practical and direct
- Prefer investigation over assumptions
- Do not invent schema, indexes, or runtime behavior
- Do not recommend index changes without explaining why they help
- Apply `@rules/sql/optimalize.mdc` "Performance Non-Regression on Query Changes" — every proposed query rewrite must be at least as fast as the original (ideally faster); a proposal that is slower must carry the documented reason and the remaining optimization options
- If DB access is unavailable, continue with static analysis and state the limitation clearly
## Execution
### 1. Identify the Query
- Find the actual SQL or reconstruct it from Laravel/Eloquent/query builder code
- Include filters, joins, ordering, grouping, pagination, and subqueries
### 2. Inspect Schema
- Inspect relevant tables and indexes using:
- schema output
- migrations
- model relationships
- DB tools when available
### 3. Run EXPLAIN
- If MySQL access is available, run `EXPLAIN`
- Review:
- table
- type
- possible_keys