sql-optimization

Optimize SQL queries and indexing across MySQL, PostgreSQL, SQL Server, and Oracle.

1|Updated Mar 20, 2026
One-click install
npx skills add https://github.com/afonsoft/VideoChat --skill sql-optimization-afonsoft
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-optimization
Source: https://github.com/afonsoft/VideoChat/tree/main/.agents/skills/sql-optimization
Command: npx skills add https://github.com/afonsoft/VideoChat --skill sql-optimization-afonsoft

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Optimizes SQL queries and indexing to maximize performance across major databases.

Core Features & Use Cases

  • Query tuning guidance for cross-database compatibility.
  • Index design recommendations and execution-plan analysis.
  • Use cases include OLTP, reporting, and analytics workloads in MySQL, PostgreSQL, SQL Server, and Oracle.

Quick Start

Analyze the provided SQL query and return a recommended index strategy.

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 queries for better performance?

SQL query optimization involves analyzing execution plans and applying index design recommendations to reduce query latency. By tuning queries, implementing batching strategies, and establishing repeatable workflows, you maximize database performance across transactional and analytical workloads.

What is an execution plan and how does it help with SQL tuning?

An execution plan details the steps a database engine takes to execute a query, serving as the primary diagnostic tool for SQL tuning. Analyzing it reveals bottlenecks like full table scans or inefficient joins, guiding targeted index design and query rewrites to improve performance.

Does this SQL optimization approach work with PostgreSQL and MySQL?

Yes, this SQL optimization approach works with PostgreSQL and MySQL, as well as SQL Server and Oracle. It provides cross-database query tuning and index design guidance, ensuring portable optimization workflows for OLTP, reporting, and analytics across these major database platforms.

What's the best way to design indexes for reporting and analytics workloads?

The best way to design indexes for reporting and analytics workloads is to analyze execution plans and align indexing strategies with specific query patterns. This approach recommends targeted composite indexes and batching techniques to optimize heavy reads without compromising transactional performance.

Why is my SQL query running slowly despite having indexes?

Your SQL query may run slowly despite having indexes due to inefficient query structure, outdated statistics, or suboptimal execution plans. Analyzing the execution plan helps identify mismatched indexes or missing batching strategies, enabling you to refine query tuning and index design for better performance.