SQL Server

Plan Guides are like duct tape

Stabilizing Execution Plans: Plan Guides and NORECOMPUTE

What could go wrong? Sometimes you end up in a good plan / bad plan situation: an important query runs just fine most of the time. The query is parameterized, a good execution plan gets re-used, everything is cool. But sometimes, a “bad plan” gets compiled and starts to be reused. This is “bad” parameter sniffing. “Bad plans” can…
Read More

Our Senior DBA Training Class: Attendee Feedback

SQL Server
3 Comments
When we finish our courses, we ask attendees what they thought. Here’s what they said about our How to Be a Senior DBA class in Chicago: “I’ve attended many trainings.  This is the most valuable I’ve ever attended.” – Tim Costello, Consultant “ROI for training is always a gamble.  However, I felt like I received…
Read More

A Manager’s Guide to Tuning Code

SQL Server
3 Comments
In your business application, you have a slow screen or function. Your team is pointing fingers between the application code, the database, and the hardware. To make it go faster, here are your main options: Tuning Options – Mark All That Apply Check all of the options you’re willing to consider, and X out all…
Read More

Why You’re Tuning Stored Procedures Wrong (the Problem with Local Variables)

There’s an important rule for tuning stored procedures that’s easy to forget: when you’re testing queries from procedures in SQL Server Management Studio, execute it as a stored procedure, a temporary stored procedure, or using literal values. Don’t re-write the statemet you’re tuning as an individual TSQL statement using local variables! Where it goes wrong…
Read More

Do Lots of Connections Slow Down Your SQL Server?

SQL Server
5 Comments
Threads are important. I sometimes hear database administrators say, “This database must be involved in our performance problem: it has too many connections.” Lots of connections might cause a problem for your SQL Server, or it might not. The good news is that there’s a way to clearly tell if they’re dragging down performance or…
Read More

How to Tell if You Need More Tempdb Files

SQL Server, TempDB
41 Comments
You may have read that you need to have more than one data file in SQL Server’s tempdb. This can happen even if you’re using blazing fast storage. If you create a lot of tiny objects in tempdb you may hit a bottleneck on special pages that SQL Server uses internally to allocate all those objects. For certain workloads, adding…
Read More

Backups, Restores, Corruption, and You: How Strong are You?

You and your databases have a strong relationship. You back them up, and check them for corruption. They provide the business with information day after day. Don’t let your relationship come to this! Then, one day, your relationship is rocked. The backups are too slow. The restores are too slow. There is…gasp…corruption. Are you prepared…
Read More