sqlserver-query-optimization

Analyze SQL Server execution plans to identify missing indexes and parameter sniffing.

Updated Feb 19, 2026
One-click install
npx skills add https://github.com/rudi-bruchez/dba-skills --skill sqlserver-query-optimization
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sqlserver-query-optimization
Source: https://github.com/rudi-bruchez/dba-skills/tree/main/skills/sqlserver-query-optimization
Command: npx skills add https://github.com/rudi-bruchez/dba-skills --skill sqlserver-query-optimization

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill addresses slow-performing SQL Server queries by providing a systematic approach to analyze execution plans, identify missing indexes, resolve parameter sniffing issues, and detect implicit type conversions, ultimately improving database responsiveness and reducing resource consumption.

Core Features & Use Cases

  • Query Analysis: Reads execution plans to pinpoint performance bottlenecks like table scans, key lookups, and inefficient joins.
  • Index Optimization: Identifies and suggests missing indexes based on query patterns and provides guidance on creating effective indexes.
  • Parameter Sniffing Fixes: Detects and offers solutions for parameter sniffing problems that lead to suboptimal query plans.
  • Implicit Conversion Resolution: Finds and helps fix data type mismatches that prevent index seeks.
  • Regression Detection: Leverages Query Store to identify and revert performance regressions.
  • Use Case: An application reports slow response times for a critical report. This Skill can analyze the underlying SQL query, identify that a missing index is causing a full table scan, and provide the exact CREATE INDEX statement to resolve the issue.

Quick Start

Analyze the performance of the stored procedure 'usp_MonthlyReport' by examining its execution plan and identifying potential optimizations.

Frequently Asked Questions about sqlserver-query-optimization

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

FAQPage Schema
How do I find missing indexes causing slow SQL Server queries?

To find missing indexes causing slow SQL Server queries, analyze the query execution plan to identify table scans and key lookups. This Skill generates exact CREATE INDEX statements based on query patterns to replace scans with efficient index seeks.

Why does parameter sniffing cause bad execution plans in SQL Server?

Parameter sniffing causes bad execution plans when SQL Server caches a plan optimized for one parameter value that performs poorly for others. This Skill detects parameter sniffing issues and provides solutions to force optimal query plans across varying parameter inputs.

How do I fix implicit conversion issues affecting SQL Server index seeks?

Fix implicit conversion issues by identifying data type mismatches between join columns or filter parameters that prevent index seeks. This Skill detects implicit type conversions in execution plans and helps align data types to restore efficient index utilization.

Can I use Query Store to detect SQL Server query performance regressions?

Yes, you can use Query Store to detect SQL Server query performance regressions. This Skill leverages Query Store data to identify plans that degraded over time and provides steps to revert to previous efficient execution plans.

Does this SQL Server performance tuning approach work on older versions?

This performance tuning approach targets SQL Server 2016 and later versions. It relies on Query Store and modern execution plan features for diagnostic tasks, so older versions without Query Store support will lack full regression detection capabilities.

What is the best way to analyze a slow SQL Server stored procedure?

The best way to analyze a slow SQL Server stored procedure is to examine its execution plan for bottlenecks like table scans and inefficient joins. This Skill systematically reads the plan and recommends specific index and parameter optimizations.