4.3a Final Lab: usp_Report3

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 Mastering Query Tuning or Recorded Class Season Pass, or log in if you already shelled out the cash.