Subject Re: [firebird-support] using indices
Author Sergio H. Gonzalez
Mmmh... I think I understand now that "value <> 0" can't use index... Am I
wrong?

I've changed
> CREATE INDEX FAC_COM_IDX4 ON FAC_COM (SALDO);
for
CREATE INDEX FAC_COM_IDX4 ON FAC_COM COMPUTED BY (ABS(SALDO));

and
> select sum(saldo) from fac_com where (saldo<>0)
for
select sum(saldo) from fac_com where ABS(SALDO)>0

and now I get the plan:

Plan
PLAN (FAC_COM INDEX (FAC_COM_IDX4))

So is that the correct way to do it?

thanks!

-s