Back to Projects

SQL Server Performance Optimization

I did comprehensive performance tuning of a struggling SQL Server instance, reducing query times by 85% and eliminating daily timeout errors.

At a glance

+85%
Speed
35%
Peak CPU
$150K
Savings
  • 85% faster queries
  • Peak CPU: 100% → 35%
  • Saved $150K by deferring hardware
SQL ServerT-SQLExtended EventsQuery StoreWindows ServerPowerShell

Problem Statement

A healthcare application was suffering from severe performance issues with query timeouts happening multiple times a day. The SQL Server was pegging at 100% CPU during business hours, and critical reports took 30+ minutes to run. The app vendor blamed the database.

Architecture & Design

I ran a comprehensive performance analysis using Extended Events, Query Store, and wait statistics. Found missing indexes, poor query patterns, and bad tempdb configuration. Designed an optimization strategy focusing on index improvements, query rewrites, and server config tuning.

Implementation Details

I created 47 targeted indexes based on missing index DMVs and execution plans. Rewrote 12 critical stored procedures to kill table scans and reduce tempdb spilling. Tuned tempdb with proper file count and sizing. Added columnstore indexes for analytical queries. Set up Resource Governor to keep runaway queries from tanking the system.

Results & Outcome

Average query time dropped by 85%. Timeout errors vanished completely. Peak CPU went from 100% to 35%. Report generation time fell from 30 minutes to 2 minutes. The client postponed a planned hardware upgrade, saving $150K.