I have a query like below.
SELECT a,b,c,d
FROM table_name
WHERE e=1 AND f=0
GROUP BY d
ORDER BY id DESC LIMIT 5
when I indexed (e,f,d) query time : 4 sec.
when I indexed (d,e,f) query time : 20 sec.
So that I understand that index colums ordering is important. Which index would be better for mysql?