Subject Re: [firebird-support] Index not used by "where xxx not null" query?
Author Helen Borrie
At 12:24 AM 28/02/2006, you wrote:


>Kjell Rilbe wrote:
>
> > My index selectivity is currently 0.125 (freshly calculated). Could that
> > be the "problem"?
>
>I'm now down to selectivity 0.066667 (freshly calculated). Same result.
>
>But on the other hand, I've got 361 nulls among a total of 581 records.
>Does Firbird detect this and decide that indices are of no use?

Regardless of the selectivity, the index is no use for a NULL/NOT
NULL selection. It doesn't care what the value is for this test -
it's only interested in whether there IS a value. (Remember, NULL
and NOT NULL are not values).

So it would be slower for it to fetch the index than to walk the set
and form the stream directly.

./heLen