Tenho uma consulta mas não sei qual índice criar para agilizá-la.
Esta é a consulta:
select
`id_my_table`
from
`my_table`
where
now() between created_data
and ifnull(finish_data, now())
and `stato` = 1
and `closed` != 1
and `closed` = 0
and `deleted` = 0
and `id_my_table_type` in (3, 5)
Não consigo alterar a consulta, só gostaria de agilizar.
Se eu EXPLAIN
fizer a consulta, vejo que o mysql não usa nenhum índice.