SQL Server 2012 Query Performance Tuning third Edition

Performance is frequently one of the last things on peoples’ minds when they’re developing a system. Unfortunately, that means it usually becomes the biggest problem after that system goes to production. You can’t simply rely on getting a phone call that tells you that procedure X on database Y that runs on server Z is running slow. You have to have a mechanism in place to find this information for yourself. You also can’t work off the general word slow. Slow compared to what? Last week? Last month? The way it ran in development? And once you’ve identified something as running slow, you need to identify why. Does it need an index? Does it have an index that it isn’t using? Is it the CPU, the disk, the memory, the number of users, the amount of data? And now you’ve identified what and why, you have to do something about it. How? Rewrite the query? Change the WHERE clause? The questions that will come your way when you start performance tuning are endless.