Why doesn't Firebird use index in my NOT something query?
It because indexes in Firebird are used to locate records that meet the criteria. When you specify that you want records that do not meet the criteria the index is useless: it would find you a record you don't want and then fetch all the other records using NATURAL table scan. Therefore it is much better to use full table scan at once.
Perhaps you have a situation where you only have a few records that do not meet the criteria, or only a few of them that do, but Firebird doesn't know that - it just knows the index selecivity and the query you supply. So, in short, the following would use an index:
where x = 1
where x > 10
where x IS NULL
where x between 1 and 10
And the following won't:
where x <> 1
where x not > 10
where x IS NOT NULL
where x NOT BETWEEN 1 and 10
As you can see, NOT expressions with 'less than' and 'greater than' operators could be rewritten to use index. Instead of:
where x not > 10
write:
where x <= 10