Skip to content
Back to skills

Sql Optimization Patterns

ASecurity

Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries. Use when debugging slow queries, designing database schemas, or optimizing application performance.

  • 3 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added September 8, 2026
databasessqldebuggingdatabaseperformance

Security analysis

A100/100

Scanned September 8, 2026

npx -y skills add agisota/old-one --skill sql-optimization-patterns --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Sql Optimization Patterns?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Sql Optimization Patterns
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/agisota-sql-optimization-patterns/badge)](https://www.skillsdirectory.com/skills/agisota-sql-optimization-patterns)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
triggers:
  - "sql optimization patterns"
name: sql-optimization-patterns
description: Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries. Use when debugging slow queries, designing database schemas, or optimizing application performance.
---

# SQL Optimization Patterns

Transform slow database queries into lightning-fast operations through systematic optimization, proper indexing, and query plan analysis.

## When to Use This Skill

- Debugging slow-running queries
- Designing performant database schemas
- Optimizing application response times
- Reducing database load and costs
- Improving scalability for growing datasets
- Analyzing EXPLAIN query plans
- Implementing efficient indexes
- Resolving N+1 query problems

## Core Concepts

### 1. Query Execution Plans (EXPLAIN)

Understanding EXPLAIN output is fundamental to optimization.

**PostgreSQL EXPLAIN:**
```sql
-- Basic explain
EXPLAIN SELECT * FROM users WHERE email = 'user@example.com';

-- With actual execution stats
EXPLAIN ANALYZE
SELECT * FROM users WHERE email = 'user@example.com';

-- Verbose output with more details
EXPLAIN (ANALYZE, BUFFERS, VERBOSE)
SELECT u.*, o.order_total
FROM users u
JOIN orders o ON u.id = o.user_id
WHERE u.created_at > NOW() - INTERVAL '30 days';
```

**Key Metrics to Watch:**

## Note
Skill content truncated for token efficiency. Full version available in the source repository.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in databases →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.