query-optimizer

Analyze SQL execution plans and rewrite queries for better performance.

29|7|Updated Oct 13, 2025
One-click install
npx skills add https://github.com/armanzeroeight/fastagent-plugins --skill query-optimizer-armanzeroeight
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: query-optimizer
Source: https://github.com/armanzeroeight/fastagent-plugins/tree/main/plugins/database-toolkit/skills/query-optimizer
Command: npx skills add https://github.com/armanzeroeight/fastagent-plugins --skill query-optimizer-armanzeroeight

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses slow-performing SQL queries by providing strategies for optimization, indexing, and rewriting, leading to faster database operations and improved application responsiveness.

Core Features & Use Cases

  • Query Analysis: Understand query execution plans using EXPLAIN and EXPLAIN ANALYZE.
  • Indexing Strategies: Learn to create single, composite, covering, partial, and expression-based indexes.
  • Query Rewriting: Transform inefficient queries (e.g., using IN with subqueries, SELECT *) into optimized versions.
  • Use Case: When a critical report takes minutes to load, use this Skill to analyze the underlying SQL, identify missing indexes or inefficient joins, and rewrite the query for near-instantaneous results.

Quick Start

Analyze the performance of the SQL query 'SELECT * FROM users WHERE email = '[email protected]';' using EXPLAIN ANALYZE.

Frequently Asked Questions about query-optimizer

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

FAQPage Schema
How do I optimize SQL query performance for slow database operations?

To optimize SQL query performance, you should analyze execution plans using EXPLAIN ANALYZE, apply advanced indexing strategies like composite or covering indexes, and rewrite inefficient queries to eliminate anti-patterns such as SELECT *.

What's the best way to use indexing strategies to reduce database load?

The best indexing strategies to reduce database load involve creating single, composite, covering, partial, and expression-based indexes tailored to your query patterns, ensuring efficient data retrieval without unnecessary overhead.

How do I rewrite inefficient SQL queries to fix performance bottlenecks?

Rewriting inefficient SQL queries involves transforming anti-patterns like IN with subqueries or SELECT * into optimized versions. This rectifies performance bottlenecks and ensures faster data retrieval for heavy reports.

Does query tuning work for identifying missing indexes on critical database reports?

Yes, query tuning works for identifying missing indexes by analyzing the underlying SQL of slow critical reports. It pinpoints inefficient joins and suggests index creation to achieve near-instantaneous results.

When should I not use expression-based indexes for SQL query optimization?

You should not use expression-based indexes when the query anti-pattern is unrelated to indexed columns, or when execution plan analysis shows the database performance bottleneck stems from inefficient joins rather than missing indexes.