sql-query-optimization

Analyze PostgreSQL SQL queries and provide optimization steps and templates.

1|Updated Dec 13, 2025
One-click install
npx skills add https://github.com/MUmerRazzaq/fast-next-todo --skill sql-query-optimization-mumerrazzaq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-query-optimization
Source: https://github.com/MUmerRazzaq/fast-next-todo/tree/main/.claude/skills/sql-query-optimization
Command: npx skills add https://github.com/MUmerRazzaq/fast-next-todo --skill sql-query-optimization-mumerrazzaq

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) and scripts (resource) components.

What problem does it solve?

This Skill addresses slow database performance caused by unoptimized SQL queries, reducing latency and resource consumption.

Core Features & Use Cases

  • Query Analysis: Provides a structured workflow for understanding and analyzing slow SQL queries.
  • Optimization Guidance: Offers checklists, best practices, and templates for indexing, rewriting joins, and reading EXPLAIN plans.
  • Use Case: For example, improving a slow report query by creating indexes, rewriting subqueries, or adjusting pagination.

Quick Start

Use the SQL query optimization skill to analyze and improve the performance of a slow-running 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 PostgreSQL queries using EXPLAIN plans?

PostgreSQL query optimization uses EXPLAIN plans to analyze execution bottlenecks. This Skill provides structured steps to interpret execution plans, identify missing indexes, and rewrite complex joins to reduce query latency and resource consumption.

What is the best way to create indexes for SQL performance tuning?

SQL performance tuning requires strategic index creation to speed up data retrieval. This Skill offers checklists and implementation templates for index strategies, guiding developers through indexing best practices to improve slow report queries.

How do I rewrite complex SQL joins and subqueries to improve database performance?

Rewriting complex SQL joins and subqueries improves database performance by minimizing unoptimized operations. This Skill provides best practices and templates for restructuring queries, adjusting pagination, and reducing latency in PostgreSQL databases.

Can I use this SQL query optimization workflow for adjusting pagination in PostgreSQL?

Yes, this SQL query optimization workflow supports adjusting pagination in PostgreSQL. It provides implementation templates and best practices for rewriting subqueries and optimizing pagination logic to reduce latency and resource consumption.

Why does my PostgreSQL report query run slowly and how can I analyze it?

PostgreSQL report queries run slowly due to unoptimized SQL structures and missing indexes. This Skill provides a structured query analysis workflow to read EXPLAIN plans, identify bottlenecks, and apply indexing or rewriting solutions.

Do I need to know how to read EXPLAIN plans to optimize SQL queries?

Reading EXPLAIN plans is essential for SQL query optimization in PostgreSQL. This Skill provides analysis steps and best practices specifically designed to help database administrators interpret execution plans for effective performance tuning.