Analyzes SQL queries and recommends indexing, rewrite, execution-plan, and data-model improvements.
---
name: sql-optimizer
description: >-
Analyze and optimize SQL queries for performance. Use when a user asks to
optimize a query, speed up a slow query, analyze a query plan, add indexes,
fix N+1 queries, reduce query time, tune database performance, or rewrite
SQL for efficiency. Supports PostgreSQL, MySQL, and SQLite.
license: Apache-2.0
compatibility: "Works with PostgreSQL, MySQL, and SQLite"
metadata:
author: terminal-skills
version: "1.0.0"
category: data-ai
tags: ["sql", "optimization", "database", "performance", "queries"]
---
# SQL Optimizer
## Overview
Analyze SQL queries for performance problems and produce optimized versions with appropriate indexes. Covers query rewriting, index recommendations, execution plan analysis, and common anti-patterns.
## Instructions
When a user asks you to optimize a SQL query or fix slow database performance, follow these steps:… install to load the full skill