第一个请求使我的服务器崩溃(CPU达到100%)

SELECT s.idSinistre
FROM test_apc_sinistres s
INNER JOIN apc_correspondances c ON c.idLiaison = s.idSinistre AND c.refCategorie = '69.1'
INNER JOIN apc_procedures_taches_sinistres p ON s.idSinistre = p.idSinistre
INNER JOIN apc_contacts co ON s.idAdb = co.idContact
INNER JOIN apc_parametres_adb pa ON pa.idAdb = co.idContact
WHERE s.refStatut = '62.2'
GROUP BY s.idSinistre;

select co.Nom, s.idSinistre, count(c.idMessage) as nbMEssage, count(p.id) as nbProc
from test_apc_sinistres s
inner join apc_correspondances c on c.idLiaison = s.idSinistre and c.refCategorie = '69.1'
inner join apc_procedures_taches_sinistres p on s.idSinistre = p.idSinistre
inner join apc_contacts co on s.idAdb = co.idContact
inner join apc_parametres_adb pa on pa.idAdb = co.idContact
where s.refStatut = '62.2'
group by s.idSinistre;


两者之间的唯一区别是我选择的数据。有人已经有这个问题了吗?

最佳答案

只需一个接一个地重新检查您的列,您会看到您正在对除一列之外的所有列进行汇总。

关于mysql - 两个请求之一使我的服务器崩溃。有人知道吗MySQL数据库,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/52425750/

10-11 02:08