Subject Re: [firebird-support] using indices
Author Anderson Farias
Hi,

> select sum(saldo) from fac_com where (ABS(SALDO)>0) and (id_proveedor =
> :id_proveedor)
> ...
> Why FB does not uses both indices?

Well, first of all, usually when you do field operations FB can't use
indexes. This is not always true if you're using FB2+ since it has features
like computed indexes. IF that's not the case here than...

...OTOH, using as much indices as it's available is not the best option, so,
is one of the indices has a lot better eficience (selectivity + restricted
condition) than I think FB optimizer will use only use only this one. In
this case I assume 'ID_PROVEDOR=x' is much better than 'SALDO>0'


Regards,
Anderson Farias