<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
if I don't have that code, and I open the opportunities filter I get
this in the mysql slow log:<br>
SELECT firstname,lastname, contactid AS id FROM
vtiger_contactdetails WHERE contactid IN ('',0);<br>
<br>
<br>
Alan.<br>
<br>
<div class="moz-cite-prefix">On 22/01/15 14:13, Prasad wrote:<br>
</div>
<blockquote
cite="mid:CAMeS7p=Oa8_9LGU8FHb6fAzpXY4jFAahjVcEj9RCBXPWMc8Mnw@mail.gmail.com"
type="cite">
<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
moz-do-not-send="true"
href="http://www.facebook.com/vtiger"
style="color:rgb(0,0,204)"
target="_blank">FB</a> I </span><a
moz-do-not-send="true"
href="http://twitter.com/vtigercrm"
style="color:rgb(0,0,204)"
target="_blank">Twit</a> I <a
moz-do-not-send="true"
href="https://www.linkedin.com/company/1270573?trk=tyah"
style="color:rgb(0,0,204)"
target="_blank">LIn</a> I <a
moz-do-not-send="true"
href="https://blogs.vtiger.com"
style="color:rgb(0,0,204)"
target="_blank">Blog</a> I <a
moz-do-not-send="true"
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 moz-do-not-send="true"
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_list);//remove blanks,
they won't have a label<br>
if ($compute) {<br>
return Vtiger_Functions::computeCRMRecordLabels($module,
$ids_list);<br>
} else {<br>
return Vtiger_Functions::getCRMRecordLabels($module,
$ids_list);<br>
}<br>
}<br>
<br>
Alan.<br>
_______________________________________________<br>
<a moz-do-not-send="true" href="http://www.vtiger.com/"
target="_blank">http://www.vtiger.com/</a><br>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
<a class="moz-txt-link-freetext" href="http://www.vtiger.com/">http://www.vtiger.com/</a></pre>
</blockquote>
<br>
</body>
</html>