That's true, in this case the database scans though too many rows. The
best solution would be to support index lookup for rows higher than a
value. This is currently supported by regular database indexes, but
not when using MVCC or in-memory indexes. This will also require some
changes elsewhere. I will add this to the roadmap, as I believe it's
currently not the most important improvement (for example, in-place
updates are more important).
Of course the trick to change AGE > 0 to AGE >= 1 works, but adding
that to the database engine is a bit tricky (it only works for integer
data types, and only for constants but not parameters as there are
problems with Integer.MAX_VALUE). Of course, a workaround is to use
this trick within the application :-)
Regards,
Thomas
Of course the trick to change AGE > 0 to AGE >= 1 works, but adding
that to the database engine is a bit tricky (it only works for integer
data types, and only for constants but not parameters as there are
problems with Integer.MAX_VALUE). Of course, a workaround is to use
this trick within the application :-)
> Couldn't you simply replace "age > 0" by "age >= 0 and age <> 0" in every
> case?
Do you mean in the database? What problem would it solve? It wouldn't
improve performance.
Regards,
Thomas