If I have a field in a table of some date type and I know that I will always be searching it using comparisons like between
, >
or <
and never =
could there be a good reason not to add an index for it?
The only reason not to add an index on a field you are going to search on is that the cost of maintaining the index overweights its benefits.
This may happen if:
DML
on your tableDML
than the fast queries.If it's not the case, then just create the index. The optimizer just won't use it if it thinks it's not needed.