<div dir="ltr">Alan,<div><br></div><div>Elimination of blank ID seem to be already taken care. Any incidence you found it is not?</div><div><br></div><div>Refer: vtlib/Vtiger/Functions.php</div><div><font face="monospace, monospace"><span style="font-size:13px">function getCRMRecord</span><span style="font-size:13px">Labels > </span></font><span style="color:rgb(0,0,0);white-space:pre-wrap;font-family:monospace,monospace">getCRMRecordMetadata($mixedid)</span></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">--</div><div dir="ltr"><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"><a href="http://www.facebook.com/vtiger" style="color:rgb(0,0,204)" target="_blank">FB</a> I </span><a href="http://twitter.com/vtigercrm" style="color:rgb(0,0,204)" target="_blank">Twit</a> I <a href="https://www.linkedin.com/company/1270573?trk=tyah" style="color:rgb(0,0,204)" target="_blank">LIn</a> I <a href="https://blogs.vtiger.com" style="color:rgb(0,0,204)" target="_blank">Blog</a> I <a href="https://www.vtiger.com/" style="color:rgb(0,0,204)" target="_blank">Website</a></div></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Thu, Jan 22, 2015 at 6:33 PM, Alan Bell <span dir="ltr"><<a href="mailto:alan.bell@libertus.co.uk" target="_blank">alan.bell@libertus.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
if you have a list of for example contacts, and you are showing a column that is a uitype 10 to the organisations then vtiger gathers up all the ids of the organisations and callsgetEntityName in include/utils/CommonUtils.php to grab all the names. If there are some blanks in the list then it calls it with $ids_list looking something like array('',4,6,144) so there is a string and a bunch of numbers. This means that when it does the SQL query it can't use the index.<br>
<br>
If you modify getEntityName so that it first ensures that $ids_list is an array (this is important, it calls it with a single ID when saving a record) then removes blanks from the array then things get a little faster on large databases. My function looks like this:<br>
<br>
function getEntityName($module, $ids_list, $compute=true) {<br>
if (!is_array($ids_list)) $ids_list = array($ids_list);<br>
$ids_list=array_filter($ids_<u></u>list);//remove blanks, they won't have a label<br>
if ($compute) {<br>
return Vtiger_Functions::<u></u>computeCRMRecordLabels($<u></u>module, $ids_list);<br>
} else {<br>
return Vtiger_Functions::<u></u>getCRMRecordLabels($module, $ids_list);<br>
}<br>
}<br>
<br>
Alan.<br>
______________________________<u></u>_________________<br>
<a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a><br>
</blockquote></div><br></div>