[Vtigercrm-developers] Query issue

Joe Bordes joe at tsolucio.com
Tue Aug 9 11:10:54 PDT 2011


This join is for the "member of" field. So if you don't use this field 
you should be ok.
It is possible that other parts of the code that use this query be affected.
I would suggest you try adding an index on parentid instead of 
eliminating the join
Let us know how it goes.

Joe
TSolucio

El 09/08/11 19:38, Nicolas Larcipretti escribió:
> Guys,
>
> I've found this query while trying to enhace the Accounts popup 
> performance and I need your opinion about it.
>
> SELECT vtiger_crmentity.crmid, vtiger_crmentity.smownerid,
>             vtiger_account.accountname, vtiger_account.email1,
>             vtiger_account.email2, vtiger_account.website, 
> vtiger_account.phone,
>             vtiger_accountbillads.bill_city,
>             vtiger_accountscf.*
>             FROM vtiger_account
>             INNER JOIN vtiger_crmentity
>                 ON vtiger_crmentity.crmid = vtiger_account.accountid
>             INNER JOIN vtiger_accountbillads
>                 ON vtiger_account.accountid = 
> vtiger_accountbillads.accountaddressid
>             INNER JOIN vtiger_accountshipads
>                 ON vtiger_account.accountid = 
> vtiger_accountshipads.accountaddressid
>             INNER JOIN vtiger_accountscf
>                 ON vtiger_account.accountid = vtiger_accountscf.accountid
>             LEFT JOIN vtiger_groups
>                 ON vtiger_groups.groupid = vtiger_crmentity.smownerid
>             LEFT JOIN vtiger_users
>                 ON vtiger_users.id <http://vtiger_users.id> = 
> vtiger_crmentity.smownerid";
> *LEFT JOIN vtiger_account vtiger_account2
>                 ON vtiger_account.parentid = vtiger_account2.accountid";*
>
> The highlighted join is the popup performance villain, and, 
> appearently, it's result is not used in the query result. I've ripped 
> it out from the query and I had 80% of performance improvement when 
> loading the Accounts popup. (I have 36.000 Accounts registered)
>
> Now here's the question: Does anyone knows why this left join is there 
> if it's not being used? Does my action will mess with any other vtiger 
> module or section? If this join is not supposed to be there, can we 
> add it's remotion in vtige's roadmap?
>
> Cheers
>
> Nicolas

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20110809/9e6b66b7/attachment-0002.html 


More information about the vtigercrm-developers mailing list