Hi all,
we have got a serious performance problem when accessing the main "Contacts" page without any search applied on it. We found out that the SQL query submitted to the MySQL-server is far away from being optimized. Beyond is the original query string from SugarCRM:
SELECT count(*) c FROM contacts
LEFT JOIN contacts_cstm ON contacts.id = contacts_cstm.id_c
LEFT JOIN accounts_contacts jtl0 ON contacts.id=jtl0.contact_id AND jtl0.deleted=0
LEFT JOIN accounts accounts ON accounts.id=jtl0.account_id AND accounts.deleted=0 AND accounts.deleted=0
LEFT JOIN users jt1 ON jt1.id= contacts.assigned_user_id AND jt1.deleted=0 AND jt1.deleted=0 where contacts.deleted=0
Executing this query takes about 2 minutes although the overall performance of Sugar is good! According to the MySQL Reference Manual the syntax could be optimized by adding a simple "contacts_cstm.id_c IS NOT NULL" to the mentioned query. So if it is possible to change the according query creation process without any side effects there could be a great performance enhancement - at least for people like us who have quite a large customization table!
Can anybody help us finding out if there are any side effects when changing the above statement. Where do we have to start? Is there some kind of help for this query creation process which we can use as a basis?
Any help would be very much appreciated! Thanks in advance!
Bernd Neukamp


LinkBack URL
About LinkBacks



Reply With Quote
Bookmarks