sql-pro

Analyze SQL execution plans and rewrite queries to fix performance bottlenecks.

Updated May 14, 2026
One-click install
npx skills add https://github.com/nkseth/copilot-dev-skills --skill sql-pro-nkseth
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: sql-pro
Source: https://github.com/nkseth/copilot-dev-skills/tree/main/skills/sql-pro
Command: npx skills add https://github.com/nkseth/copilot-dev-skills --skill sql-pro-nkseth

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

SQL performance issues are addressed by identifying bottlenecks, analyzing execution plans, and optimizing data access patterns.

Core Features & Use Cases

  • Schema Analysis: Review database structure, keys, constraints, and patterns to identify bottlenecks.
  • Query Optimization: Rewrite queries using set-based operations, CTEs, and window functions for better performance.
  • Index Design: Propose covering and composite indexes to reduce I/O and improve plan efficiency.
  • Use Case: Imagine a dashboard with slow aggregated queries; this skill helps rewrite, index, and explain plans to meet latency targets.

Quick Start

Provide a concise set-based rewrite and indexing plan for a given slow query.

Frequently Asked Questions about sql-pro

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

FAQPage Schema
How do I fix slow SQL query performance on a dashboard with aggregated data?▼

Fix slow SQL query performance by analyzing execution plans, rewriting queries with set-based operations, and adding covering or composite indexes to reduce I/O and meet latency targets.

How does analyzing an execution plan help identify SQL performance bottlenecks?▼

Analyzing an execution plan helps identify SQL performance bottlenecks by revealing inefficient data access patterns, scanning operations, and missing indexes, allowing targeted query rewrites and schema adjustments.

Can I optimize complex SQL queries involving window functions and subqueries across different databases?▼

Yes, you can optimize complex SQL queries involving window functions, joins, and subqueries across PostgreSQL, MySQL, SQL Server, and Oracle by applying set-based optimization and benchmarking before and after results.

What is the best way to design composite indexes for slow running queries?▼

The best way to design composite indexes is to analyze data access patterns and execution plans, then propose covering and composite indexes that directly reduce I/O and improve plan efficiency for slow running queries.

When should I use CTEs to rewrite queries for better performance?▼

Use CTEs to rewrite queries for better performance when dealing with complex joins and subqueries, allowing you to apply set-based operations that improve readability and execution plan efficiency.