Out-of-range messages

Out-of-range messages are printed when a search argument is out of range of the values included in the histogram for an indexed column.

The following clause searches for a value greater than the last title_id:

    where title_id > "Z"

dbcc traceon(302) prints:

Estimated selectivity for title_id,
   selectivity = 0.000000, upper limit = 0.000000.
Lower bound search value ’’Z’’ is greater than the largest value in sysstatistics for this column.

For a clause that searches for a value that is less than the first key value in an index, dbcc traceon(302) prints:

Estimated selectivity for title_id,
    selectivity = 0.000000, upper limit = 0.000000.
Upper bound search value ’’B’’ is less than the smallest value
in sysstatistics for this column.

If the equality operator is used instead of a range operator, the messages read:

Estimated selectivity for title_id,
   selectivity = 0.000000, upper limit = 0.000000.
Equi-SARG search value ’’Zebracode’’ is greater than the largest value in sysstatistics for this column.

or:

Estimated selectivity for title_id,
   selectivity = 0.000000, upper limit = 0.000000.
Equi-SARG search value ’’Applepie’’ is less than the smallest value in sysstatistics for this column.

These messages may simply indicate that the search argument used in the query is out of range for the values in the table. In that case, no rows are returned by the query. However, if there are matching values for the out-of-range keys, it may indicate that it is time to run update statistics on the table or column, since rows containing these values must have been added since the last time the histogram was generated.

There is a special case for search clauses using the >= operator and a value that is less than or equal to the lowest column value in the histogram. For example, if the lowest value in an integer column is 20, this clause:

where col1 >= 16

produces this message:

Lower bound search condition ’>= 16’ includes all values in this column.

For these cases, the optimizer assumes that all non-null values in the table qualify for this search condition.