data-sql

Analyze SQL explain plans and optimize queries across relational databases.

2|Updated Mar 1, 2026
One-click install
npx skills add https://github.com/nholder88/ai-agent-workflows --skill data-sql-nholder88
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: data-sql
Source: https://github.com/nholder88/ai-agent-workflows/tree/main/skills/data-sql
Command: npx skills add https://github.com/nholder88/ai-agent-workflows --skill data-sql-nholder88

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

PostgreSQL, MySQL, SQL Server, SQLite, and Oracle projects often suffer from poorly written queries and suboptimal explain plans that waste compute and slow down applications. This skill provides a structured approach to SQL query design, performance tuning, and explain analysis to deliver robust, efficient data access.

Core Features & Use Cases

  • Query design and optimization: craft efficient SELECTs, JOINs, CTEs, and upserts tailored to the target dialect.
  • Explain-driven tuning: analyze execution plans and recommend indexing strategies to eliminate bottlenecks.
  • Use Case: diagnose a slow product search query and produce a plan that reduces runtime from seconds to milliseconds on large datasets.

Quick Start

Provide a concrete SQL query design and optimization plan for a given schema and workload.

Frequently Asked Questions about data-sql

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

FAQPage Schema
How do I optimize SQL queries for faster performance on large datasets?

To optimize SQL queries, you analyze execution plans to identify bottlenecks, apply targeted indexing strategies, and rewrite complex joins or CTEs to eliminate unnecessary compute waste on large datasets.

What does an SQL explain plan tell me about query bottlenecks?

An SQL explain plan reveals the execution path of your query, showing where the database performs full table scans instead of using indexes, allowing you to restructure joins and apply indexing to eliminate bottlenecks.

Does this SQL optimization approach support PostgreSQL and MySQL dialects?

Yes, this approach detects dialect differences and supports query optimization across PostgreSQL, MySQL, SQL Server, SQLite, and Oracle, ensuring syntax and indexing strategies match the target database.

What is the best way to design complex SQL upserts and window functions?

The best way to design complex SQL upserts and window functions is to tailor the syntax to your specific relational database dialect, ensuring efficient data access patterns while avoiding suboptimal execution plans.

When should I review my database schema for SQL performance tuning?

You should review your database schema for SQL performance tuning when applications slow down, as schema reviews alongside explain-driven analysis help identify missing indexes and restructure complex joins for faster queries.