The name of the column that is being investigated.
The value to which the column is compared. The default is NULL.
The comparison operator used for the comparison, enclosed in single quotes. Possible values for this parameter are: '='
, '>' , '<' , '>=' , '<=' , '<>' , '!=' , '!<' , and '!>'. The default is '='.
The following list shows the selectivity estimate sources that ESTIMATE_SOURCE returns. For more information about the sources,
see Selectivity estimate sources.
Selectivity estimate source
Stored column statistics
Average of all values stored in the column statistics
Built-in guesses that are defined for each type of predicate. This is returned only when there is no relevant index to use,
no statistics have been collected for the referenced columns, or the predicate is a complex predicate.
Other sources than the ones described above
Returned when the specified predicate is always true
One or more of the above sources
Returned when there are upper and/or lower bounds placed on the selectivity estimate
This function returns the source of the selectivity estimate for the predicate column-namerelation-stringvalue. If value is NULL and the relation string is '=', the selectivity source is for the predicate column-name IS NULL. If value is NULL and the relation string is '!=' or '<>', the selectivity source is for the predicate column-name IS NOT NULL.
The following statement returns the selectivity source Index for evaluating whether the first value in the EmployeeID column
is greater than 200. Returning Index means that the query optimizer used an index to estimate the selectivity.
SELECT FIRST ESTIMATE_SOURCE( EmployeeID, 200, '>' )
ORDER BY 1;