Hi All,<br><br>This issue is reported on trac (<a href="http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/6108">http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/6108</a>) and we have recently integrated the changes.<br><br><div>
<span class="gmail_quote">On 7/1/09, <b class="gmail_sendername">Lee Valentine</b> <<a href="mailto:lee@leev.net">lee@leev.net</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Ding,<br> <br> That was just applied to 5.1rc2. However I did the query originally in 5.0.4.<br> <br> Thanks,<br> Lee<br> <br> <br> 2009/7/1 ding jianting <<a href="mailto:dfar2008@gmail.com">dfar2008@gmail.com</a>>:<br>
<br>> Hi,Lee<br> > What is version of your vtigerCRM?<br> ><br> > On Wed, Jul 1, 2009 at 8:21 AM, Lee Valentine <<a href="mailto:lee@leev.net">lee@leev.net</a>> wrote:<br> >><br> >> Hey Guys,<br>
>><br> >> We were having performance issues with the crm taking ages to load so<br> >> I had all the queries being executed printed to the screen with the<br> >> duration each query was taking. I found:<br>
>><br> >> select distinct(setype) from vtiger_crmentity where crmid in (select<br> >> parent_id from vtiger_troubletickets)<br> >> 106.894966125 seconds.<br> >><br> >> I tracked this down to modules/CustomView/CustomView.php line 1212 (in<br>
>> function getSalesRelatedName)<br> >> $sql = "select distinct(setype) from vtiger_crmentity where crmid in<br> >> (select ". $adb->sql_escape_string($fieldname)." from ".<br> >> $adb->sql_escape_string($tablename).")";<br>
>><br> >> I replaced it with the following:<br> >> $sql = "select distinct(setype) from vtiger_crmentity c INNER JOIN<br> >> ".$adb->sql_escape_string($tablename)." t ON<br> >> t.".$adb->sql_escape_string($fieldname)." = c.crmid";<br>
>><br> >> And received the result:<br> >> select distinct(setype) from vtiger_crmentity c INNER JOIN<br> >> vtiger_troubletickets t ON t.parent_id = c.crmid<br> >> 0.0270490646362 seconds.<br>
>><br> >> This has given our crm a MAJOR performance increase.<br> >><br> >> Thanks,<br> >> Lee<br> >> _______________________________________________<br> >> Reach hundreds of potential candidates - <a href="http://jobs.vtiger.com">http://jobs.vtiger.com</a><br>
><br> ><br> ><br> > --<br> > ________________________________________<br> > 上海易客CRM 丁远<br> > 地址:上海市徐汇区零陵路零陵路631号爱乐大厦<br> > 电话:021-64876448 传真:021-64876441<br> > 手机:(0)13701696656 <a href="mailto:Email%3Adfar2008@gmail.com">Email:dfar2008@gmail.com</a><br>
> -----------------------------------------------------------------------<br> ><br> > _______________________________________________<br> > Reach hundreds of potential candidates - <a href="http://jobs.vtiger.com">http://jobs.vtiger.com</a><br>
><br> <br> _______________________________________________<br> Reach hundreds of potential candidates - <a href="http://jobs.vtiger.com">http://jobs.vtiger.com</a> </blockquote></div><br><br clear="all"><br>-- <br>Regards,<br>
Asha<br>vtiger Team