sql-optimization

Analyze SQL execution plans and recommend indexing and query-tuning improvements.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/ngmthaq/my-copilot --skill sql-optimization-ngmthaq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-optimization
Source: https://github.com/ngmthaq/my-copilot/tree/main/skills/sql-optimization
Command: npx skills add https://github.com/ngmthaq/my-copilot --skill sql-optimization-ngmthaq

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

SQL performance is often bottlenecked by suboptimal execution plans, missing indexes, and inefficient query patterns across multiple database engines. This Skill provides universal techniques to analyze and optimize queries across MySQL, PostgreSQL, SQL Server, Oracle, and other engines, helping teams improve response times and throughput.

Core Features & Use Cases

  • Execution plan analysis and guidance for rewriting queries to leverage indexes and better plan shapes.
  • Indexing strategy recommendations, including composite, covering, and partial indexes tailored to common query patterns.
  • Pagination and batch operation optimizations to improve throughput on large datasets.
  • Cross-database performance monitoring guidance and best practices for measuring improvements and regression risks.
  • Use Case: Optimize a slow reporting query by reducing scan cost and improving join performance, then validate with plan changes.

Quick Start

Provide a prioritized optimization plan for a slow SQL query, including indexing recommendations and a rewritten version of the query.

Frequently Asked Questions about sql-optimization

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

FAQPage Schema
How do I optimize slow SQL query performance using execution plan analysis?

Optimize SQL query performance by analyzing execution plans to identify scan cost issues and recommending indexing or query-tuning improvements. This approach reduces bottlenecks by rewriting queries to leverage better plan shapes across MySQL, PostgreSQL, SQL Server, and Oracle.

What's the best way to improve pagination and batch processing throughput on large datasets?

Improve pagination and batch processing throughput by applying specific SQL query optimization techniques for large datasets. This Skill provides tailored pagination strategies that minimize scan costs and enhance overall database response times.

Does this SQL optimization approach work across multiple database engines?

Yes, this SQL optimization approach works across multiple database engines including MySQL, PostgreSQL, SQL Server, and Oracle. It provides universal techniques for plan optimization and cross-database compatibility to ensure measurable performance gains.

How do I choose the right indexing strategy for common SQL query patterns?

Choose the right indexing strategy by analyzing execution plans to recommend composite, covering, and partial indexes tailored to your common SQL query patterns. This ensures efficient index usage and safe plan changes for your specific database workload.

How do I validate performance improvements after rewriting a slow SQL query?

Validate SQL query performance improvements through cross-database performance monitoring guidance and best practices. This Skill helps measure response time gains and identify regression risks after rewriting queries and applying indexing recommendations.

When should I avoid rewriting queries for execution plan optimization?

Avoid rewriting SQL queries for execution plan optimization when safe plan changes cannot be guaranteed or measurable performance gains are not possible. Cross-database performance monitoring guidance helps identify regression risks before applying query-tuning improvements.