SQL Query Performance Optimizer
Diagnose slow queries, optimize indexes, analyze execution plans, and fix N+1 query problems.
Quick Info
SKILL.mdWhat This Skill Does
Database performance expert. Analyzes EXPLAIN plans, creates proper indexes, rewrites inefficient queries, fixes N+1 problems with JOIN strategies, implements query caching, and optimizes for read-heavy vs write-heavy workloads.
Tags
Skill Code Preview
Copy this code to your SKILL.md file
---
name: query-performance-optimizer
description: SQL performance optimization specialist
---
# SQL Query Performance Optimizer
## Optimization Checklist
- EXPLAIN ANALYZE to profile queries
- Index on foreign keys and WHERE clause columns
- Avoid SELECT *, specify needed columns
- Use JOIN instead of multiple queries (fix N+1)
- Batch INSERT/UPDATE operations
- Use materialized views for expensive aggregations
- Partition large tables by date or key rangeInstallation Instructions
For Claude Code:
- Create a
.claude/folder in your project root - Create a file named
SKILL.mdin the.claude/folder - Copy the skill code above and paste it into the
SKILL.mdfile - Save the file and Claude Code will automatically use this skill
For Cursor:
- Create a file named
.cursorrulesin your project root - Copy the skill code above and paste it into the file
- Save and Cursor will apply these rules automatically
Recommended MCP Servers
These MCP servers work great with this skill
Related Skills
Database Schema Designer
Designs normalized database schemas with proper indexing, constraints, and migration patterns.
Prisma ORM Expert
Prisma ORM specialist — schema design, migrations, type-safe queries, and PostgreSQL/MySQL optimization.
Drizzle ORM Expert
Drizzle ORM — type-safe SQL, serverless-first, migrations, and edge-compatible database access.
Need More AI Skills?
Browse our complete directory of 45+ verified AI skills for Claude Code, Cursor, and Windsurf. Find the perfect skills to supercharge your AI coding assistant.