Yoav Apter <yo...@checkpoint.com> wrote:
> I have the following table:
> 
> CREATE TABLE x ('col1', 'col2', 'col3')
> Create col1index on x ('col1')
> 
> When I run this query: "select * from x where col1 is null" I see the index 
> on x is used.
> When I run this query: "select * from x where col1 is NOT null" I see the 
> index on x is not used.

Why is that suprising? Imagine you are given a book with an index at the end, 
and are asked to enumerate all pages where a particular term does *not* appear. 
Would an index be helpful in this task?

> How can indexes be used with "not null" queries?

They cannot.
-- 
Igor Tandetnik

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to