query-optimization
EXPLAIN PLAN analysis, index selection, join strategies, and slow query debugging.
от sethdford★ 51 звезда на GitHub
Установить query-optimization в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Query Optimization
Making queries fast through understanding execution plans and indexes.
Context
You are optimizing slow queries. Use EXPLAIN PLAN to understand execution.
Domain Context
- Execution Plan: How database executes query; cost is estimate
- Sequential Scan: Reads all rows; slow on large tables
- Index Scan: Uses index; much faster if selective
- Join Strategy: Nested loop, hash, sort-merge; tradeoffs
- Cardinality: Rows filtered at each step
Instructions
- Identify Slow Queries: Slow logs, application monitoring
- Get EXPLAIN PLAN: Understand how database executes query
- Look for Scans: Sequential scan on large table = problem
- Add Indexes: On columns in WHERE, JOIN, ORDER BY
- Verify Join Order: Database should join most selective first
- Rewrite if Needed: Sometimes different query is faster
- Monitor: Re-check plan after schema changes
Anti-Patterns
- Optimizing without EXPLAIN PLAN; guessing is unreliable
- Adding indexes for every column; slows writes, wastes storage
- Not updating stats; optimizer makes bad decisions
- Complex queries database can't optimize; rewrite
- Indexes on queries that return too much (unconstrained)
Further Reading
- PostgreSQL EXPLAIN documentation
- MySQL EXPLAIN documentation
- SQL Antipatterns (Joe Celko), Chapter on queries
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл query-optimization?
EXPLAIN PLAN analysis, index selection, join strategies, and slow query debugging.
Как установить скилл query-optimization?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл query-optimization запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
AnthropicCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…