December 2002
Intermediate to advanced
1560 pages
40h 44m
English
The first step in query optimization is to analyze each table in the query to identify all search arguments (SARGs), OR clauses, and join clauses. The SARGs, OR clauses, and join clauses will be used in the second step, index selection, to select useful indexes to satisfy a query.
A search argument (SARG) is defined as a WHERE clause comparing a column to a constant. The format of a SARG is as follows:
Column operator constant_expression [and...]
SARGs provide a way for the 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 any one of =, >, <, >=, and <=, BETWEEN, and sometimes LIKE ...
Read now
Unlock full access