[Vtigercrm-developers] Query issue

Nicolas Larcipretti niclarcipretti at gmail.com
Tue Aug 9 10:38:00 PDT 2011


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


More information about the vtigercrm-developers mailing list