December 2013
Intermediate to advanced
1872 pages
153h 31m
English
A SARG is defined as a WHERE clause that compares a column to a constant. The format of a SARG is as follows:
Column operator constant_expression [and...]
SARGs provide a way for the Query Optimizer to limit the rows searched to satisfy a query. The general goal is to match a SARG with an index to avoid a table scan. Valid operators for a SARG are =, >, <, >=, and <=, BETWEEN, and LIKE. Multiple SARGs can be combined with the AND clause. (A single index might match some or all of the SARGs ANDed together.) Following are examples of SARGs:
flag = 7
salary > 100000
city = 'Saratoga' and ...