data-sql-optimization

Installation
SKILL.md

SQL Optimization — Comprehensive Reference

This skill provides actionable checklists, patterns, and templates for transactional (OLTP) SQL optimization: measurement-first triage, EXPLAIN/plan interpretation, balanced indexing (avoiding over-indexing), performance monitoring, schema evolution, migrations, backup/recovery, high availability, and security.

Supported Platforms: PostgreSQL, MySQL, SQL Server, Oracle, SQLite

For OLAP/Analytics: See data-lake-platform (ClickHouse, DuckDB, Doris, StarRocks)


Quick Reference

Task Tool/Framework Command When to Use
Query Performance Analysis EXPLAIN ANALYZE EXPLAIN (ANALYZE, BUFFERS) SELECT ... (PG) / EXPLAIN ANALYZE SELECT ... (MySQL) Diagnose slow queries, identify missing indexes
Find Slow Queries pg_stat_statements / slow query log SELECT * FROM pg_stat_statements ORDER BY total_exec_time DESC LIMIT 10; Identify performance bottlenecks in production
Index Analysis pg_stat_user_indexes / SHOW INDEX SELECT * FROM pg_stat_user_indexes WHERE idx_scan = 0; Find unused indexes, validate index coverage
Schema Migration Flyway / Liquibase flyway migrate / liquibase update Version-controlled database changes
Backup & Recovery pg_dump / mysqldump pg_dump -Fc dbname > backup.dump Point-in-time recovery, disaster recovery
Related skills
Installs
123
GitHub Stars
60
First Seen
Jan 23, 2026