Q2:
explain extended SELECT x.id, x.betgame_id, x.coupon_code, x.home_team, x.visit_team, x.code, x.start_timestamp, d.start_date, d.start_time, d.bet_field, d.from_value, d.to_value, d.status, d.status_game FROM kouponidb_prognosi_xml x LEFT JOIN kouponidb_prognosi_xml_diff d ON x.coupon_code = d.coupon_code AND x.betgame_id = d.betgame_id AND x.code = d.code WHERE x.start_date >= '2013-11-27' AND (d.status IS NOT NULL OR d.status_game IS NOT NULL OR d.start_date IS NOT NULL) ORDER BY d.id ASC
Q3:
explain extended select k.`short_tournament`, k.`home_team`, k.`visit_team`, k.`status` as st1, k.`start_date` as or_start_date, k.`start_time` as or_start_time, d.*
from kouponi_xml_diff d inner join kouponi_xml k on k.betgame_id=d.betgame_id
where d.`full_id`=589
and (k.`status`='active' || k.`status`='blocked')
order by d.`rec_time` desc, d.`id` desc
Q4:
explain extended SELECT x.id, x.home_team, x.visit_team, x.code, x.start_timestamp, d.bet_field, d.from_value, d.to_value, d.status, d.status_game FROM kouponidb_prognosi_xml x LEFT JOIN kouponidb_prognosi_xml_diff d ON x.coupon_code = d.coupon_code AND x.betgame_id = d.betgame_id AND x.code = d.code WHERE x.start_date >= '2013-11-23' AND d.bet_field IS NOT NULL AND d.to_value IS NOT NULL GROUP BY d.bet_field, d.betgame_id , d.coupon_code , d.code ORDER BY id DESC
See the thing is that your slow query log is geenrated from
2013-09-25 09:15:52 to 2013-11-28 13:22:57
when you posted your topic 11-25-2013, 04:53 AM
so it would be good to generate slow log only from last 24h
so remove current slow log /var/log/mysql/mysql-slow.log
and run
mysql
flush logs;
to recreate it again for 24 h
explain extended SELECT x.id, x.betgame_id, x.coupon_code, x.home_team, x.visit_team, x.code, x.start_timestamp, d.start_date, d.start_time, d.bet_field, d.from_value, d.to_value, d.status, d.status_game FROM kouponidb_prognosi_xml x LEFT JOIN kouponidb_prognosi_xml_diff d ON x.coupon_code = d.coupon_code AND x.betgame_id = d.betgame_id AND x.code = d.code WHERE x.start_date >= '2013-11-27' AND (d.status IS NOT NULL OR d.status_game IS NOT NULL OR d.start_date IS NOT NULL) ORDER BY d.id ASC
Q3:
explain extended select k.`short_tournament`, k.`home_team`, k.`visit_team`, k.`status` as st1, k.`start_date` as or_start_date, k.`start_time` as or_start_time, d.*
from kouponi_xml_diff d inner join kouponi_xml k on k.betgame_id=d.betgame_id
where d.`full_id`=589
and (k.`status`='active' || k.`status`='blocked')
order by d.`rec_time` desc, d.`id` desc
Q4:
explain extended SELECT x.id, x.home_team, x.visit_team, x.code, x.start_timestamp, d.bet_field, d.from_value, d.to_value, d.status, d.status_game FROM kouponidb_prognosi_xml x LEFT JOIN kouponidb_prognosi_xml_diff d ON x.coupon_code = d.coupon_code AND x.betgame_id = d.betgame_id AND x.code = d.code WHERE x.start_date >= '2013-11-23' AND d.bet_field IS NOT NULL AND d.to_value IS NOT NULL GROUP BY d.bet_field, d.betgame_id , d.coupon_code , d.code ORDER BY id DESC
See the thing is that your slow query log is geenrated from
2013-09-25 09:15:52 to 2013-11-28 13:22:57
when you posted your topic 11-25-2013, 04:53 AM
so it would be good to generate slow log only from last 24h
so remove current slow log /var/log/mysql/mysql-slow.log
and run
mysql
flush logs;
to recreate it again for 24 h