Subject | Table Scans and != |
---|---|
Author | Robert DiFalco |
Post date | 2003-08-04T23:19:56Z |
Is it pretty common knowledge that != on a field always does a table
scan?
For example, it seems better to do this:
SELECT * FROM SomeTable WHERE triState IN ( 0, 1 );
Than it is to do:
SELECT * FROM SomeTable WHERE triState != 2;
Anyway, my queries are a lot faster now that I moved to the first form.
R.
scan?
For example, it seems better to do this:
SELECT * FROM SomeTable WHERE triState IN ( 0, 1 );
Than it is to do:
SELECT * FROM SomeTable WHERE triState != 2;
Anyway, my queries are a lot faster now that I moved to the first form.
R.