Data Workflows

Database Query Optimization Analyst

Analyze slow database queries and create evidence-based optimization plans using execution plans, indexes, schema, and workload context.

Last updated Jul 11, 2026
FreeClaudeChatGPTCursor
TL;DR

Database Query Optimization Analyst is a free AI skill for data workflows. Analyze slow database queries and create evidence-based optimization plans using execution plans, indexes, schema, and workload context. It works with Claude, ChatGPT, Cursor and is ready to use out of the box.

Download Skill.md Package

About this skill

Database Query Optimization Analyst helps developers diagnose and improve slow relational database queries without guessing. It reviews SQL, execution plans, cardinality, indexes, joins, filters, sorting, locking, data distribution, and application behavior.

What it does

The skill separates measured bottlenecks from assumptions, identifies plan and schema issues, proposes safe query and index changes, evaluates write and storage tradeoffs, and produces verification, rollout, and rollback steps.

What is included

  • Query and workload context
  • Execution-plan analysis
  • Index assessment
  • Join and filter findings
  • Locking and concurrency review
  • Optimization options
  • Verification queries
  • Rollout and rollback plan

How to use it

1. Download the database-query-optimization-analyst-SKILL.md file
2. Upload it to your development or data workspace
3. Provide the SQL, execution plan, schema, row counts, and latency evidence
4. Add database engine and production constraints
5. Use the plan to test and deploy optimizations

Examples

Example input
Analyze a PostgreSQL query that joins projects, users, events, and metrics, filters by tenant and date, sorts by latest activity, and takes eight seconds.
Example output
An evidence-based diagnosis covering plan nodes, cardinality, missing composite indexes, sort cost, tenant filtering, query rewrite options, index tradeoffs, test queries, and rollout steps.

FAQ

What is this skill for?
It diagnoses slow relational queries and creates a safe optimization plan.
Do I need an execution plan?
It is strongly recommended because it shows how the database actually executes the query.
Will it always recommend an index?
No. The problem may involve query shape, statistics, joins, data model, locking, or application behavior.
Can an index make performance worse?
Yes. Indexes add storage, write, maintenance, and planning costs.
Does it support PostgreSQL and MySQL?
Yes, when the engine and plan format are clearly identified.
How is this different from a database schema review?
It focuses on a measured query and workload rather than the whole data model.

Related Skills

Data WorkflowsFree

Database Schema and Migration Planner

Design relational database schemas and safe migration plans with constraints, indexes, data backfills, rollback, and verification.

ClaudeChatGPTCursor
#database schema#SQL migration#data modeling
Data WorkflowsFree

Data Migration Verification Manager

Plan and verify data migrations with mapping, reconciliation, sampling, cutover, rollback, audit evidence, and sign-off.

ClaudeChatGPTCursor
#data migration#migration verification#data reconciliation
Data WorkflowsFree

Customer Retention Analyst

Analyzes churn or retention data to find the specific segment and likely cause behind customer loss, not just the overall churn rate.

ClaudeChatGPTCursor
#customer retention#churn analysis#customer success

Related Prompts

Free

Database Query Performance Investigator

Analyze a slow database query using execution evidence, data distribution, indexes, and workload constraints before recommending changes.

ClaudeChatGPT
#sql-performance#query-plan#database-indexing