query-optimize

Analyze and optimize SQL/NoSQL queries with N+1 detection and index recommendations.

1|Updated Jan 26, 2026
One-click install
npx skills add https://github.com/manastalukdar/claude-devstudio --skill query-optimize
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: query-optimize
Source: https://github.com/manastalukdar/claude-devstudio/tree/main/skills/query-optimize
Command: npx skills add https://github.com/manastalukdar/claude-devstudio --skill query-optimize

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill addresses database performance bottlenecks by analyzing and optimizing SQL and NoSQL queries, detecting common issues like N+1 problems, and recommending appropriate indexes.

Core Features & Use Cases

  • N+1 Query Detection: Identifies inefficient query patterns common in ORMs.
  • Index Recommendations: Suggests missing indexes based on query analysis.
  • Query Plan Analysis: Provides insights into query execution for PostgreSQL, MySQL, MongoDB, and SQLite.
  • Use Case: A developer notices their application is running slowly. They use this Skill to analyze their database queries, identify that many findMany calls within loops are causing N+1 issues, and receive recommendations to use eager loading and add specific indexes to improve performance.

Quick Start

Use the query-optimize skill to analyze the database queries in the current project.

Frequently Asked Questions about query-optimize

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

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

Fix N+1 query problems by analyzing your ORM code to detect inefficient findMany calls within loops and replacing them with eager loading. This Skill detects these patterns in ORMs like Prisma, TypeORM, and SQLAlchemy to improve performance.

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

Optimize slow SQL queries by performing query plan analysis to identify execution bottlenecks in PostgreSQL and MySQL. This Skill analyzes your database queries and recommends missing indexes to significantly improve application performance.

Does this database optimization tool work with MongoDB and SQLite?

Yes, this database optimization tool works with MongoDB and SQLite, alongside PostgreSQL and MySQL. It provides specific query plan analysis and index recommendations for both SQL and NoSQL databases to resolve performance issues.

Can I analyze Mongoose and Django ORM queries for missing indexes?

Yes, you can analyze Mongoose and Django ORM queries for missing indexes. This Skill supports ORMs including Mongoose, Django ORM, Prisma, TypeORM, Sequelize, and SQLAlchemy, detecting N+1 patterns and suggesting appropriate indexes.

What is the best way to detect missing database indexes for slow applications?

The best way to detect missing database indexes is to analyze your query execution plans and query patterns. This process identifies missing indexes based on query analysis and recommends specific indexes to add for improved database performance.

How do I analyze database query execution plans for performance bottlenecks?

Analyze database query execution plans by examining how SQL and NoSQL queries execute under the hood. This Skill provides query plan analysis to pinpoint performance bottlenecks and recommends indexes or query rewrites to resolve them.