Many expressions are converted into literal search strings before query optimization. In the following examples, the processed expressions are shown as they appear in the search argument analysis of dbcc traceon(302) output:
Operation |
Example of where Clause |
Processed expression |
---|---|---|
Implicit conversion |
|
|
Conversion function |
|
|
Arithmetic |
|
|
Math functions |
|
|
String functions |
|
|
String concatenation |
|
|
Date functions |
|
getdate() cannot be optimized. |
These conversions allow the optimizer to use the histogram values for a column rather than using default selectivity values.
The following are exceptions:
The getdate function
Most system functions such as object_id or object_name
These are not converted to literal values before optimization.