O'Reilly logo

Microsoft® SQL Server 2012 Unleashed by Alex T. Silverstein, Chris Gallelli, Paul T. Bertucci, Ray Rankins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How the Statistics Histogram Is Used

The histogram steps are used for SARGs only when a constant expression is compared against an indexed column and the value of the constant expression can be determined at query compile time. The following SARG examples show where histogram steps can be used:

Image where col_a = getdate()

Image where cust_id= 12345

Image where monthly_sales < 10000 / 12

where LastName like "Smith" + "%"

Some constant expressions cannot be evaluated ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required