sql-query-optimization

Analyze EXPLAIN plans and execution times to optimize SQL queries.

1|Updated May 5, 2026
One-click install
npx skills add https://github.com/kollaborai/kollab --skill sql-query-optimization-kollaborai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-query-optimization
Source: https://github.com/kollaborai/kollab/tree/main/bundles/skills/sql-query-optimization
Command: npx skills add https://github.com/kollaborai/kollab --skill sql-query-optimization-kollaborai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates slow, inefficient SQL queries that cause high database latency, wasted compute resources, and poor application performance by providing disciplined, measurement-driven optimization practices.

Core Features & Use Cases

  • Performance Analysis: Use EXPLAIN plans and execution time measurement to identify query bottlenecks across SQLite, PostgreSQL, and MySQL databases.
  • Optimization Best Practices: Apply proven techniques for SELECT, WHERE, JOIN, index, and aggregation optimization to reduce query runtime.
  • Use Case: If your customer order reporting query takes 15 seconds to run on a 1 million row dataset, use this Skill to rewrite it with proper indexes and filtering to execute in under 200ms.

Quick Start

Use the sql-query-optimization skill to analyze and speed up your slow product inventory lookup query.

Frequently Asked Questions about sql-query-optimization

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

FAQPage Schema
How do I optimize slow SQL queries in PostgreSQL and MySQL?

To optimize slow SQL queries, you analyze EXPLAIN plans and execution times to identify bottlenecks, then apply index tuning and rewrite anti-patterns in SELECT, WHERE, and JOIN clauses to reduce runtime.

What is the best way to speed up a query taking seconds on a million row dataset?

The best way to speed up a query on a million row dataset is applying disciplined measurement practices to rewrite reporting queries with proper indexes and filtering, reducing execution time to under 200ms.

Does this SQL optimization approach work with SQLite databases?

Yes, this query optimization approach works with SQLite databases, applying index optimization and performance measurement techniques to reduce latency for both transactional and read-heavy workloads.

How do I use EXPLAIN plans to eliminate SQL query bottlenecks?

You use EXPLAIN plans to identify query bottlenecks by reviewing execution paths, applying best practices to eliminate anti-patterns in aggregations and WHERE clauses, and measuring the resulting execution time reduction.

When should I use index tuning for database performance optimization?

You should use index tuning for database performance optimization when transactional or reporting workloads degrade responsiveness, requiring measurement-driven index adjustments and SQL best practices to lower operational costs.