Subject Re: [firebird-support] Table Scans and !=
Author Daniel Rail
Hi,

At August 4, 2003, 21:41, Robert DiFalco wrote:

> Indeed. What I found interesting (and I guess it makes sense once I
> think it through) is that:

> column != value (or column <> value)

Also, "NOT (column = value)", doesn't use an index, because the engine
doesn't have a specific value as a reference to retrieve the other
records, from the database. And, it probably uses the same logic no
matter what the type of field the column is defined as(varchar,
numeric, etc...). Maybe, the optimizer can be optimized for numeric
fields in this scenario, but don't expect that to happen in FB 1.5,
but there are plans to further improve the optimizer in FB 2.

For numeric values, you can also use
"(column < value) or (column > value)", and that should use the index.

--
Best regards,
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)