sql-pro

Optimize SQL queries and schemas across PostgreSQL, MySQL, SQL Server, and Oracle.

10.9k|1.0k|Updated Oct 20, 2025
One-click install
npx skills add https://github.com/Jeffallan/claude-skills --skill sql-pro
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-pro
Source: https://github.com/Jeffallan/claude-skills/tree/main/skills/sql-pro
Command: npx skills add https://github.com/Jeffallan/claude-skills --skill sql-pro

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps optimize queries, design schemas, and analyze execution plans across PostgreSQL, MySQL, and SQL Server for reliable performance.

Core Features & Use Cases

  • Query patterns: CTEs, window functions, and advanced joins.
  • Indexing & design: Crafting covering and composite indexes.
  • Explain analysis: Interpreting EXPLAIN/ANALYZE results and optimization steps.

Quick Start

Start with an EXPLAIN ANALYZE on a slow query and propose a covering index.

Frequently Asked Questions about sql-pro

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize slow SQL queries using EXPLAIN ANALYZE?

EXPLAIN ANALYZE shows execution plans and actual row counts, revealing bottlenecks like sequential scans or missing indexes. Run EXPLAIN ANALYZE on your slow query, identify high-cost operations, then propose covering indexes or rewrite joins to reduce resource consumption.

What's the best way to design indexes for query performance in PostgreSQL and MySQL?

Covering indexes include all columns a query needs, eliminating table lookups. Composite indexes order columns by selectivity and filter conditions. Analyze query patterns with EXPLAIN to target high-frequency operations and validate improvements on production-scale data.

Can I use window functions and CTEs to improve query performance?

Window functions and CTEs enable set-based operations that often outperform row-by-row logic. They organize complex queries into readable stages, reduce intermediate result sets, and leverage indexes effectively. Test execution plans to confirm performance gains.

How do I optimize schema design for large databases across PostgreSQL, MySQL, and SQL Server?

Schema optimization involves normalizing structure, choosing appropriate data types, and creating strategic indexes. Document design rationale and validate with production-scale data to ensure queries execute efficiently across multiple database engines.

When should I use covering indexes instead of standard indexes?

Use covering indexes when queries fetch specific columns repeatedly and table lookups become expensive. Covering indexes store all needed columns, eliminating secondary table access. They trade storage for query speed in high-throughput ETL and production contexts.

Can query optimization techniques apply to ETL pipelines and complex joins?

Yes. ETL pipelines benefit from optimized joins, efficient indexing, and set-based operations on large datasets. EXPLAIN ANALYZE reveals join strategies; covering indexes reduce I/O; window functions aggregate data efficiently across production-scale volumes.