sql-optimization

Analyzes and optimizes SQL queries across multiple database platforms and dialects.

2|Updated Apr 6, 2026
One-click install
npx skills add https://github.com/bingeli1379/eli-marketplace --skill sql-optimization-bingeli1379
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-optimization
Source: https://github.com/bingeli1379/eli-marketplace/tree/main/plugins/sdd-database/skills/sql-optimization
Command: npx skills add https://github.com/bingeli1379/eli-marketplace --skill sql-optimization-bingeli1379

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill assists in fine-tuning SQL queries to enhance performance on various SQL databases, including SQL Server, T-SQL, Oracle, PostgreSQL, and MySQL.

Core Features & Use Cases

  • Universal SQL Optimization: Focuses on optimization techniques that are applicable across multiple SQL dialects.
  • Query Performance Analysis: Provides examples of efficient and inefficient query patterns with index strategies.
  • Index Strategy Optimization: Offers guidelines for creating and managing indexes for optimal query performance.
  • Subquery Optimization: Demonstrates how to refactor correlated subqueries for better performance using window functions.
  • JOIN and Pagination Optimization: Explains the differences between inefficient and optimized JOINs and pagination strategies.
  • Aggregation Optimization: Shows how to use conditional aggregation to reduce the need for multiple queries.
  • Anti-Patterns: Highlights common anti-patterns and how to avoid them.
  • Database-Agnostic Optimization: Offers general advice on batch operations and temporary table usage.
  • Index Management: Discusses index design principles and partial index strategies.
  • Performance Monitoring: Provides database-specific queries for identifying slow queries and performance bottlenecks.
  • Optimization Checklist: Offers a comprehensive checklist for SQL performance optimization.
  • Methodology: Details the optimization methodology including identifying bottlenecks, analyzing execution plans, and testing optimizations.

Quick Start

Use the SQL optimization skill to analyze the performance of the following query and provide recommendations for improvement:

SELECT * FROM orders WHERE status = 'pending';

Frequently Asked Questions about sql-optimization

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

FAQPage Schema
How do I optimize SQL query performance across different database dialects?

SQL query performance optimization across SQL Server, Oracle, PostgreSQL, and MySQL is achieved by applying indexing strategies, refactoring inefficient queries, and analyzing execution plans. This Skill provides dialect-specific monitoring queries and universal optimization techniques to reduce query latency.

What are common SQL anti-patterns that slow down database queries?

Common SQL anti-patterns include inefficient JOIN structures, correlated subqueries, and improper pagination strategies. This Skill identifies these performance bottlenecks and demonstrates how to refactor them using window functions and conditional aggregation for better database performance.

How do I create an effective index strategy for slow SQL queries?

An effective index strategy requires analyzing execution plans to identify bottlenecks and applying index design principles. This Skill offers guidelines for creating, managing, and utilizing partial indexes to ensure optimal SQL query performance across various database systems.

Can I use this SQL optimization methodology for PostgreSQL and MySQL?

Yes, this SQL optimization methodology applies to PostgreSQL, MySQL, SQL Server, T-SQL, and Oracle. It focuses on identifying bottlenecks, analyzing execution plans, and testing optimizations using database-agnostic techniques alongside dialect-specific performance monitoring queries.

What is the best way to optimize SQL pagination and JOIN operations?

The best way to optimize SQL pagination and JOINs is to replace inefficient query patterns with optimized strategies. This Skill explains the differences between inefficient and optimized JOINs and provides pagination techniques to minimize database overhead.

Why does analyzing execution plans help with query tuning?

Analyzing execution plans helps with query tuning by revealing how databases process queries and where bottlenecks occur. This Skill details an optimization methodology that uses execution plan analysis to guide indexing decisions and query refactoring for improved performance.