data-sql-optimization

Installation
SKILL.md

SQL Optimization

Operational guidance for transactional SQL systems. This skill is strongest on PostgreSQL, MySQL, and SQL Server for query tuning, plan analysis, index strategy, connection pressure, lock contention, and safe production changes.

Primary coverage: PostgreSQL, MySQL, SQL Server Lighter coverage: Oracle, SQLite Out of scope: OLAP engines and lakehouse tuning. Use data-lake-platform for ClickHouse, DuckDB, Doris, StarRocks, Iceberg, Delta Lake, or Hudi.

Quick Reference

Scripts

Script What it does Usage
scripts/pg_slow_query_triage.sql Five-section triage report from pg_stat_statements: top by total time, mean time, I/O, variance, and cache-hit ratio Copy-paste into psql or any SQL client; requires pg_stat_statements extension
scripts/explain_collector.py Runs EXPLAIN (ANALYZE, BUFFERS, FORMAT JSON) on a list of queries via psql, outputs JSONL DATABASE_URL=postgresql://... python explain_collector.py --queries slow.txt
Installs
208
GitHub Stars
79
First Seen
Jan 23, 2026
data-sql-optimization — vasilyu1983/ai-agents-public