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. <br>
<br>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.<br><br>Please, tell me if I'm missing something or this is really some older version garbage left behind.<br>
<br>Cheers<br><br>Nicolas<br><br><div class="gmail_quote">2011/8/9 Joe Bordes <span dir="ltr"><<a href="mailto:joe@tsolucio.com">joe@tsolucio.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div 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ó:
<div><div></div><div class="h5"><blockquote 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 href="http://vtiger_users.id" target="_blank">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>
</div></div></div>
<br>_______________________________________________<br>
<a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a><br></blockquote></div><br>