• Environment is everything. Check the big picture before checking the small picture.

    Developers will tell me procedure XYZ is timing out on a customer's site and needs optimized. The first thing I ask is what are the Big statistics for the host machine for disk, memory usage, and cpu when the procedure is not running. It generally ends up being something IT has done such as implement a crazy rule like "do full backups of all SIMPLE MODE databases during the day". Well, I have 50 GB readonly databases in SIMPLE Mode that never need backed up.

    SqlServer is a system of many background processes, agent jobs, users, all affecting each other. Also most servers are virtual and fighting for minimal physical resources such as one RAID 5 subsystem; this prevents you from knowing the actual available resources in many cases. Often it is much cheaper and faster to add a couple RAID 1 disk channels than to optimize every procedure for equal gains.