🚨 3 Performance Fixes I Made at a Client Site That Changed Everything 🚨
Sometimes ignorance is bliss—until your system crashes during peak load. I recently worked with a client who said, “We just have one slow report.” What we found was much bigger: a set of silent performance killers hiding in plain sight.
Here are the three key fixes I made that had an immediate impact:
✅ 1. Replaced Scalar Functions with Inline Table-Valued Functions
They had a scalar UDF used in a report that ran 2M times per execution.
Issue: It forced serial execution and killed parallelism.
Fix: Rewrote it as an inline TVF and used CROSS APPLY.
Result: Report runtime dropped from 18 minutes to 34 seconds.
🔍 Root cause: Devs didn’t review execution plans or understand function impact on query optimizer.
✅ 2. Cleaned Up 38 Indexes on One Table (!)
One critical table had 38 indexes—many unused or overlapping.
Issue: Sluggish writes, bloated storage, poor batch job performance.
Fix: Dropped 26 unused indexes, merged others, and added filtered indexes.
Result: Write performance improved 3x; update jobs finished in ¼ the time.
🔍 Root cause: No indexing strategy. Indexes were added reactively and never reviewed.
✅ 3. Reconfigured TempDB Properly
Yes, they still had one TempDB data file—on a 16-core machine.
Issue: Severe allocation contention, frequent deadlocks, high CPU.
Fix: Added 8 TempDB data files, enabled trace flag 1118, and balanced sizes.
Result: Blocking disappeared, CPU usage dropped, parallelism improved.
🔍 Root cause: “Default settings” from day one were never reviewed or tuned.
💡 Final Thought:
Each of these fixes helped—but they also revealed a bigger theme: the real bottleneck was lack of awareness. Performance tuning isn’t black magic—it’s knowing where to look and asking the right questions.
🛠️ If you’ve got reports dragging, batch jobs crawling, or unexplained deadlocks—it’s probably not "just slow code." It's often overlooked defaults or forgotten decisions.
If you’re facing similar issues, let’s talk.
Drop your toughest tuning story in the comments—what did you fix that changed everything?
#SQLServer #PerformanceTuning #DatabaseOptimization #TempDB #Indexing #ExecutionPlans #Consulting #PinalDave