query-optimizer

Analyze SQL and ORM queries for N+1 patterns and missing indexes.

Updated Apr 12, 2026
One-click install
npx skills add https://github.com/KILWA73/MiniSoc --skill query-optimizer-kilwa73
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: query-optimizer
Source: https://github.com/KILWA73/MiniSoc/tree/main/.agents/skills/query-optimizer
Command: npx skills add https://github.com/KILWA73/MiniSoc --skill query-optimizer-kilwa73

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Analysts and developers waste time diagnosing slow queries and missing indexes in ORM/SQL code, leading to dropped performance and user frustration.

Core Features & Use Cases

  • Query analysis and detection of N+1 patterns and unindexed predicates
  • Eager loading recommendations to reduce round trips
  • Index suggestions for complex filtering and joins
  • Use cases include rapidly speeding up endpoints, reports, and admin dashboards that suffer from database bottlenecks.

Quick Start

Provide an optimized SQL/ORM query and explain the execution plan.

Frequently Asked Questions about query-optimizer

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

FAQPage Schema
How do I fix N+1 query issues in my ORM code?

To fix N+1 query issues, you analyze your ORM query structure to apply eager loading recommendations, which batch related data retrievals and reduce database round trips.

What is the best way to optimize slow SQL queries and missing indexes?

The best way to optimize slow SQL queries is to analyze the query structure to generate index recommendations for complex filtering and joins, alongside optional raw SQL rewrites for unindexed predicates.

How do I analyze an execution plan for unindexed predicates?

You analyze an execution plan by providing your SQL or ORM query to identify unindexed predicates, which reveals missing indexes and allows the system to propose targeted index suggestions for complex filtering.

Does query optimization work for speeding up admin dashboards and reports?

Yes, query optimization works for speeding up admin dashboards and reports by analyzing data-retrieval paths and endpoints suffering from database bottlenecks to propose eager loading and index recommendations.

When should I use raw SQL rewrites instead of ORM query optimization?

You should use raw SQL rewrites when ORM query optimization cannot sufficiently resolve complex filtering and joins, providing an optional alternative to generate more efficient execution plans for slow queries.