If I use
.. WHERE UNIX_TIMESTAMP(`some_timestamp`)>NOW()
in a SELECT, does this query still make use on an index, set on some_timestamp
?
If I use
in a SELECT, does this query still make use on an index, set on |
|||
|
No. Up to now, the optimizer in all MySQL versions cannot use an index for such a condition. It is not sargable If you want it to be able to use indexes, you'll have to use a function to rewrite/reverse your condition so no function is applied on the column:
What to use, depends on the column If it is a
If
or the equivalent:
Check MySQL documentation: |
|||||||||||
|