Cases ListView too slow | Slow Query


I am facing an issue with Cases module ListView id is too slow. I enabled the slow queries and found this query it is taking almost 90 seconds to load.

SELECT , cases.account_id , cases.assigned_user_id , cases.case_number ,  , account_name , accounts.assigned_user_id account_name_owner  , 'Accounts' account_name_mod, cases.priority , cases.status  , jt1.user_name assigned_user_name , jt1.created_by assigned_user_name_owner  , 'Users' assigned_user_name_mod, cases.date_entered , cases.created_by  
FROM cases  
LEFT JOIN cases_cstm ON = cases_cstm.id_c   
LEFT JOIN  accounts accounts ON AND accounts.deleted=0
   AND accounts.deleted=0  
LEFT JOIN  users jt1 ON AND jt1.deleted=0
   AND jt1.deleted=0 where cases.deleted=0 
ORDER BY cases.date_entered DESC LIMIT 0,21

Can anyone help with this issue?


try running from phpMyAdmin the first query in this post:

Also check how many of your records have deleted=1, since these can be removed from the database if needed.