Subject Re: [firebird-support] Index not used by "where xxx not null" query?
Author Kjell Rilbe
Helen Borrie wrote:

> At 12:24 AM 28/02/2006, you wrote:
>
> 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.

OK, I understand, but why DOES the "is null" query use the index then?
What I don't understand why it's not the same for "is null" and "is not
null". Note: this holds true no matter what the percentage of records
with null is.

Kjell
--
--------------------------------------
Kjell Rilbe
Adressmarknaden AM AB
E-post: kjell.rilbe@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64