sql-optimization

Analyze SQL execution plans and recommend index optimizations.

Updated Nov 21, 2025
One-click install
npx skills add https://github.com/lluppesms/dadabase.demo --skill sql-optimization-lluppesms
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-optimization
Source: https://github.com/lluppesms/dadabase.demo/tree/main/.github/skills/sql-optimization
Command: npx skills add https://github.com/lluppesms/dadabase.demo --skill sql-optimization-lluppesms

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the critical need for optimizing SQL database performance, ensuring queries run efficiently, and databases remain responsive under load.

Core Features & Use Cases

  • Query Tuning: Analyzes and rewrites inefficient SQL queries.
  • Indexing Strategies: Recommends and optimizes database indexes for faster data retrieval.
  • Performance Analysis: Provides guidance on identifying and resolving bottlenecks across various SQL databases.
  • Use Case: Optimize a slow-running SELECT statement that is causing application lag by analyzing its execution plan and suggesting appropriate index additions.

Quick Start

Use the sql-optimization skill to analyze and optimize the provided SQL query for PostgreSQL.

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 queries causing application lag?

To optimize slow SQL queries, you can analyze the execution plan to identify bottlenecks and rewrite the query for better performance. This involves applying indexing strategies and pagination optimization to ensure efficient data retrieval.

What is the best way to analyze a database execution plan for query tuning?

Analyzing an execution plan for query tuning involves examining how the database engine executes a query to identify inefficient operations. It helps pinpoint missing indexes or costly table scans so you can rewrite the query for optimal performance.

How do I add database indexes for faster data retrieval?

Adding database indexes for faster data retrieval requires identifying the columns used in WHERE clauses and JOIN conditions. By creating targeted indexes based on execution plan analysis, you drastically reduce the amount of data scanned during queries.

Does this SQL query tuning approach work across multiple database dialects?

Yes, this SQL query tuning approach provides universal optimization guidance across multiple SQL dialects. It offers database-specific performance metrics and indexing strategies tailored to the unique characteristics of your specific SQL environment.

When should I use batch operations for database performance optimization?

You should use batch operations for database performance optimization when processing large volumes of data or running bulk updates. Batching reduces transaction overhead and minimizes locking contention, keeping your database responsive under heavy load.

Why does my SQL pagination cause performance issues on large datasets?

SQL pagination causes performance issues on large datasets when using OFFSET, because the database must scan and discard all skipped rows. Optimizing pagination requires using cursor-based or keyset pagination techniques to avoid expensive offset scans.