Subject Re: Performance.
Author Svein Erling
--- In firebird-support@yahoogroups.com, "colinriley666" wrote:
> Many thanks. its speeded up enormously. The sql select that i
> posted was trimmed down for clarity. Thats why the index was
> specified a 2nd time.
> I dont understand, however, why the "or 2 = 0" inhibits the use of
> the index.

Well, I think that when using OR, Firebird needs an index for both
requirements to believe using an index would help, and since it has
neither an index for 2 nor for 0 (or any other constant or expression)
it decides to avoid the index entirely. Though I'm basically just
happy that it works and have never really tried to figure out why ;o)

Set