Mysql Connection丢失

时间:2017-09-09 05:48:04

标签: mysql codeigniter

我有一个带有codeigniter的项目。我基于4表做了一个查询。它w =工作正常,但现在总入门50000+。现在当我查询它时丢失了mysql连接。我增加了超时和缓冲区大小。但不行。这是qyery:

select temp.id office_id , temp.office_name, temp.svcic,
  count(service_transaction.service_id) as service_total 
from 
  (select users.id, users.office_name ,service_list.id svcic 
   from users,service_list WHERE users.del_status = 0 
   and users.type='agency' 
   and service_list.del_status = 0 
   and users.id != '-1' ) temp 
LEFT JOIN service on temp.id = service.office_id 
  and service.del_status = 0 
  AND (service.date BETWEEN '2017-08-09' AND '2017-09-09') 
LEFT JOIN service_transaction on service_transaction.service_id = temp.svcic 
  and service_transaction.service_transaction_id = service.id 
LEFT JOIN recipient on recipient.id = service.recipient_number 
  and recipient.gender != 'all' 
group by temp.id , temp.office_name, temp.svcic 
ORDER BY temp.office_name

enter image description here

现在该怎么办?

0 个答案:

没有答案