[Vtigercrm-commits] [vtiger development] #6108: Subquery in CustomView.php causing slow load of homepage
vtiger development
vtiger-tickets at trac.vtiger.com
Tue Jun 30 20:28:26 EDT 2009
#6108: Subquery in CustomView.php causing slow load of homepage
--------------------------+-------------------------------------------------
Reporter: brett.hooker | Owner: developer
Type: defect | Status: new
Priority: major | Milestone: 5.1.0
Component: vtigercrm | Version: 5.1.0-wip
Keywords: |
--------------------------+-------------------------------------------------
We were having performance issues with 5.1 taking ages to load the
Homepage so
we had all the queries being executed printed to the screen with the
duration each query was taking. We found:
select distinct(setype) from vtiger_crmentity where crmid in (select
parent_id from vtiger_troubletickets)
106.894966125 seconds.
We tracked this down to modules/CustomView/CustomView.php line 1212 (in
function getSalesRelatedName)
$sql = "select distinct(setype) from vtiger_crmentity where crmid in
(select ". $adb->sql_escape_string($fieldname)." from ".
$adb->sql_escape_string($tablename).")";
I replaced it with the following:
$sql = "select distinct(setype) from vtiger_crmentity c INNER JOIN
".$adb->sql_escape_string($tablename)." t ON
t.".$adb->sql_escape_string($fieldname)." = c.crmid";
And received the result:
select distinct(setype) from vtiger_crmentity c INNER JOIN
vtiger_troubletickets t ON t.parent_id = c.crmid
0.0270490646362 seconds.
This has given our crm a MAJOR performance increase.
--
Ticket URL: <http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/6108>
vtiger development <http://trac.vtiger.com/>
vtigerCRM
More information about the vtigercrm-commits
mailing list