<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
This join is for the "member of" field. So if you don't use this
field you should be ok.<br>
It is possible that other parts of the code that use this query be
affected.<br>
I would suggest you try adding an index on parentid instead of
eliminating the join<br>
Let us know how it goes.<br>
<br>
Joe<br>
TSolucio<br>
<br>
El 09/08/11 19:38, Nicolas Larcipretti escribió:
<blockquote
cite="mid:CAK10WeADH0xKT8k2nfKwQT1yd3Y-iF40uJ47u8XrE1feW0jSFg@mail.gmail.com"
type="cite">Guys,<br>
<br>
I've found this query while trying to enhace the Accounts popup
performance and I need your opinion about it.<br>
<br>
SELECT vtiger_crmentity.crmid, vtiger_crmentity.smownerid,<br>
vtiger_account.accountname, vtiger_account.email1,<br>
vtiger_account.email2, vtiger_account.website,
vtiger_account.phone,<br>
vtiger_accountbillads.bill_city,<br>
vtiger_accountscf.*<br>
FROM vtiger_account<br>
INNER JOIN vtiger_crmentity<br>
ON vtiger_crmentity.crmid =
vtiger_account.accountid<br>
INNER JOIN vtiger_accountbillads<br>
ON vtiger_account.accountid =
vtiger_accountbillads.accountaddressid<br>
INNER JOIN vtiger_accountshipads<br>
ON vtiger_account.accountid =
vtiger_accountshipads.accountaddressid<br>
INNER JOIN vtiger_accountscf<br>
ON vtiger_account.accountid =
vtiger_accountscf.accountid<br>
LEFT JOIN vtiger_groups<br>
ON vtiger_groups.groupid =
vtiger_crmentity.smownerid<br>
LEFT JOIN vtiger_users<br>
ON <a moz-do-not-send="true"
href="http://vtiger_users.id">vtiger_users.id</a> =
vtiger_crmentity.smownerid"; <br>
<b style="background-color: rgb(255, 255, 0);">LEFT
JOIN vtiger_account vtiger_account2<br>
ON vtiger_account.parentid =
vtiger_account2.accountid";</b><br>
<br>
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)<br>
<br>
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?<br>
<br>
Cheers <br>
<br>
Nicolas<br>
</blockquote>
<br>
</body>
</html>