sql-query-optimizer

Analyze SQL EXPLAIN plans and recommend index strategies.

1|Updated Nov 6, 2025
One-click install
npx skills add https://github.com/zinohome/CozyChat --skill sql-query-optimizer-zinohome
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-query-optimizer
Source: https://github.com/zinohome/CozyChat/tree/main/.claude/skills/sql-query-optimizer
Command: npx skills add https://github.com/zinohome/CozyChat --skill sql-query-optimizer-zinohome

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill addresses slow-performing SQL queries by providing a comprehensive approach to analysis, optimization, and performance benchmarking.

Core Features & Use Cases

  • EXPLAIN Analysis: Interprets query execution plans to identify bottlenecks.
  • Index Recommendations: Suggests optimal indexes for improved query speed.
  • Query Rewrites: Offers strategies to refactor queries for better efficiency.
  • Performance Benchmarking: Compares query performance before and after optimization.
  • Automated Slow Query Detection: Configures and queries database logs for slow statements.
  • Use Case: A developer is experiencing slow response times on a critical API endpoint. They can use this Skill to analyze the underlying SQL query, identify missing indexes or inefficient joins, and receive actionable steps to improve performance.

Quick Start

Use the sql-query-optimizer skill to analyze the provided SQL query and suggest optimizations.

Frequently Asked Questions about sql-query-optimizer

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

FAQPage Schema
How do I analyze SQL execution plans to identify query bottlenecks?

SQL execution plans are analyzed by interpreting EXPLAIN output to identify performance bottlenecks like missing indexes or inefficient joins. This Skill reads EXPLAIN plans and pinpoints specific areas causing slow database queries.

What is the best way to optimize slow database queries caused by missing indexes?

The best way to optimize slow database queries is by recommending optimal index strategies based on execution plan analysis. This Skill suggests specific indexes and provides query rewrite suggestions to improve overall query speed.

How do I measure SQL query performance before and after optimization?

SQL query performance is measured through performance benchmarking, which compares execution metrics before and after applying optimizations. This Skill facilitates benchmarking to validate that index recommendations and query rewrites improve speed.

Can I use this Skill to detect slow SQL statements automatically in my database logs?

Yes, you can detect slow SQL statements automatically by configuring and querying database logs for slow statements. This Skill scripts automated slow query detection to surface problematic database queries without manual log review.

Does this SQL query optimizer work with Prisma setups?

Yes, this SQL query optimizer integrates with Prisma setups to analyze underlying database queries. It requires understanding of SQL execution plans and database indexing principles to effectively optimize queries generated by the Prisma ORM.

Why do I need to understand database indexing principles to optimize SQL queries?

Understanding database indexing principles is required because optimal SQL query tuning relies on interpreting execution plans and applying correct index strategies. This Skill provides recommendations, but you need indexing knowledge to implement them effectively.