sql-pro

Optimizes SQL queries, designs schemas, and analyzes execution plans across database dialects.

Updated Jul 4, 2026
One-click install
npx skills add https://github.com/100Thieves-team/plady-expert-skills --skill sql-pro-100thieves-team
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-pro
Source: https://github.com/100Thieves-team/plady-expert-skills/tree/main/.claude/skills/sql-pro
Command: npx skills add https://github.com/100Thieves-team/plady-expert-skills --skill sql-pro-100thieves-team

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Slow queries, missing indexes, and poorly designed schemas degrade application performance, and diagnosing them requires deep knowledge of execution plans, window functions, and dialect-specific behavior that most developers lack. ## Core Features & Use Cases - Query Optimization: Analyzes EXPLAIN/ANALYZE output, eliminates sequential scans, and creates covering indexes to hit sub-100ms targets. - Schema Design: Designs normalized schemas with proper keys, constraints, and indexing strategies. - Dialect Migration: Translates queries between PostgreSQL, MySQL, SQL Server, and Oracle while respecting platform-specific optimizations. - Use Case: A reporting query with a correlated subquery takes 30 seconds. The skill rewrites it as a set-based aggregation join, adds a covering index, and verifies the improvement with before/after EXPLAIN ANALYZE benchmarks. ## Quick Start Ask the assistant to analyze why your SQL query is slow and optimize it with proper indexes and an execution plan review.

Frequently Asked Questions about sql-pro

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

FAQPage Schema
How do I optimize a slow SQL query?

Start by running EXPLAIN ANALYZE to see actual row counts versus estimates. Look for sequential scans on large tables, add or fix indexes, filter rows early before joins, and rewrite correlated subqueries as set-based aggregation joins.

How to read EXPLAIN ANALYZE output in PostgreSQL?

Run EXPLAIN with ANALYZE, BUFFERS, and FORMAT TEXT options. Check for Seq Scan on large tables indicating missing indexes, actual rows far exceeding estimated rows signaling stale statistics, and high buffer read counts indicating cache misses.

What is the difference between CTEs and subqueries in SQL?

CTEs isolate expensive logic for reuse and readability, letting you filter early and reference the result multiple times. Subqueries, especially correlated ones, execute once per outer row and are typically slower than an equivalent aggregation join.

Does query syntax differ between PostgreSQL, MySQL, and SQL Server?

Yes, dialects differ in date functions, pagination syntax, index features like PostgreSQL covering indexes with INCLUDE, and optimizer behavior. The skill loads dialect-specific guidance from its references when targeting a particular platform.

When should I use a covering index?

Use a covering index when a frequent query touches a fixed set of columns, so the database can answer entirely from the index without reading the table. In PostgreSQL, add non-key columns with the INCLUDE clause.