[Vtigercrm-developers] Query issue

Nicolas Larcipretti niclarcipretti at gmail.com
Tue Aug 9 11:19:13 PDT 2011


Yes, I do know that whoever made this query, intended to use this join to
find the "member of" information. However, if you take a closer look to the
query, there's no reference to the join return at all.

A simple test: execute this query in vtiger's mysql database and you'll see
in the result that there's no "parent" information in it.

Please, tell me if I'm missing something or this is really some older
version garbage left behind.

Cheers

Nicolas

2011/8/9 Joe Bordes <joe at tsolucio.com>

>  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 = 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
>
>
>
> _______________________________________________
> http://www.vtiger.com/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20110809/a36247e3/attachment-0002.html 


More information about the vtigercrm-developers mailing list