4.3d Final Lab: usp_Report3 (15m)

This query accepts a @SinceLastAccessDate parameter, and right now SQL Server’s doing an index scan on a reporting table to get it. A LastAccessDate index alone doesn’t help because even with relatively short date ranges, we’re still going to blow past the tipping point where key lookups make sense. A rewrite with pagination can help.

To access this incredible, amazing content, you gotta get Live Class Season Pass, Live Class Season Pass PLUS Lab VM or Mastering Query Tuning, or log in if you already shelled out the cash.