AnsweredAssumed Answered

Sugar server getting down in outlook Sync query

Question asked by pavan agrawal on Oct 30, 2018

Hello Team,

 

I don't know but when I logged in SugarCRM application using chrome mobile then multiple query is running on server for each module such as Notes, Contacts, Opportunities, Accounts.

 

Query Sample in Contacts -

 

SELECT DISTINCT contacts.id id, contacts.date_modified date_modified FROM contacts  LEFT JOIN contacts_cstm ON contacts.id = contacts_cstm.id_c   LEFT JOIN  users jt0 ON contacts.modified_user_id=jt0.id AND jt0.deleted=0

 

 AND jt0.deleted=0  LEFT JOIN  users jt1 ON contacts.created_by=jt1.id AND jt1.deleted=0

 

 AND jt1.deleted=0  LEFT JOIN  accounts_contacts jtl2 ON contacts.id=jtl2.contact_id AND jtl2.deleted=0
 AND jtl2.primary_account = 1
 LEFT JOIN  accounts accounts ON accounts.id=jtl2.account_id AND accounts.deleted=0
 AND accounts.deleted=0   LEFT JOIN  accounts_contacts jtl3 ON contacts.id=jtl3.contact_id AND jtl3.deleted=0
 AND jtl3.primary_account = 1
 LEFT JOIN  accounts jt3 ON jt3.id=jtl3.account_id AND jt3.deleted=0
 AND jt3.deleted=0   LEFT JOIN  opportunities_contacts opportunities_contacts ON contacts.id=opportunities_contacts.contact_id AND opportunities_contacts.deleted=0

 

 LEFT JOIN  opportunities jt4 ON jt4.id=opportunities_contacts.opportunity_id AND jt4.deleted=0
 AND jt4.deleted=0   LEFT JOIN  contacts jt5 ON contacts.reports_to_id=jt5.id AND jt5.deleted=0

 

 AND jt5.deleted=0  LEFT JOIN  campaigns jt6 ON contacts.campaign_id=jt6.id AND jt6.deleted=0

 

 AND jt6.deleted=0  LEFT JOIN  calls_contacts jtl7 ON contacts.id=jtl7.contact_id AND jtl7.deleted=0

 

 LEFT JOIN  calls jt7 ON jt7.id=jtl7.call_id AND jt7.deleted=0
 AND jt7.deleted=0   LEFT JOIN  meetings_contacts jtl8 ON contacts.id=jtl8.contact_id AND jtl8.deleted=0

 

 LEFT JOIN  meetings jt8 ON jt8.id=jtl8.meeting_id AND jt8.deleted=0
 AND jt8.deleted=0  LEFT JOIN tag_bean_rel jt9
                                     ON contacts.id=jt9.bean_id
                                     AND jt9.deleted=0 LEFT JOIN tags jt10
                                     ON jt9.tag_id=jt10.id
                                     AND jt9.deleted=0  LEFT JOIN  users jt11 ON contacts.assigned_user_id=jt11.id AND jt11.deleted=0

 

 AND jt11.deleted=0  LEFT JOIN  team_sets ts1 ON contacts.team_set_id=ts1.id AND ts1.deleted=0

 

 AND ts1.deleted=0  LEFT JOIN  teams tj ON contacts.team_id=tj.id AND tj.deleted=0

 

 AND tj.deleted=0 where contacts.deleted=0 ORDER BY contacts.date_modified DESC, contacts.id DESC LIMIT 0,20

 

 

Please suggest how and when these type query runs. Thanks!

Outcomes