Most rule-based planners,
including WHINIT from SPD Server, assume that the index has a uniform
distribution of values between the upper and lower value boundaries.
This means if data values range between 2 and 10, that there are an
equal number of 3s and 4s, and so on. When the assumption of a uniform
distribution is false, an indexed predicate can return a large number
of records. In turn, this causes WHINIT's indexed plan to run slower
than a sequential read of the entire table. In this case the index
should be suppressed.
Here is another, more
subtle instance. When the WHERE clause uses only the front part of
the key, WHINIT selects a composite index. Assume an index
abcd on
columns A, B, C, and D, and an index
e on
column E, and specify the WHERE clause
where a = 3 and e = 5;
Normally, WHINIT will
select both indexes (
abcd and
e)
and choose EVAL1. However, using the index
abcd just
to interrogate
'a' might return
a large number of records. In this case, suppressing the
abcd index
might be a good idea. If so, WHINIT will still choose EVAL1 for
e
= 5, or EVAL3 if SPDSWEV1=NO, and EVAL2, the post-filter,
for
a = 3.