有些特定的查询语句能够秒出,但是show processlist 一直都存在这条sql查询记录,而且一直都在query状态,并且执行这条语句后,无法执行任何的语句,会卡死。并且同样的sql语句查询条件dt换成不同的日期范围,就不会出现该现状。
特定sql语句:
select * from (select dt,sum(consume) as consume,sum(cost) as cost,sum(new_mobile) as new_mobile,sum(new_mobile_day) as new_mobile_day,sum(new_income_money) as new_income_money,sum(new_income_user) as new_income_user,sum(new_account) as new_account,sum(real_income_money) as real_income_money,sum(income_user) as income_user,sum(dau) as dau,sum(roi_1) as roi_1,SUM(IF(DATEDIFF(DATE_SUB(CURDATE(),interval 0 day),dt)<0,0,cost)) as roi_1_d,sum(click) as click,sum(show) as show from game_tf_report_v4.report_base_day b join (select id,owner,sso_owner,media_dept_id,media_master_id,media_id,agent_id,dept_id,dept_group_id,vest_id from game_tf_report_v4.game_cate_monitor k ) g on b.monitor_sn=g.id where dt >= ‘2021-06-01’ and dt <= ‘2021-06-22’ group by dt) t order by dt desc limit 0,10;
日志每次会抛出多条这个警告
[client_batch.go:632] [“wait response is cancelled”] [to=10.0.2.21:20163] [cause=“context canceled”]