When I upgraded MySQL to version 5.6, I was in trouble because some queries were slow. As a result of a lot of ggg, the information that hit is as follows.
character_set_connection = sjis and DATETIME columns are not indexed http://bugs.mysql.com/bug.php?id=74449 It seems that only in the case of character_set_connection = sjis, incorrect type conversion is performed on DATETIME and DATE type columns. It's a good idea not to stop sjis, but unfortunately it's not a system that can throw away sjis, so it's dealt with with CAST as follows.
For date type
AND dl.date >= '2014-08-10'
↓
AND dl.date >= cast('2014-08-10' as date)
For datetime type
AND dl.date >= '2014-08-10'
↓
AND dl.date >= cast('2014-08-10' as datetime)
For your reference.