<div dir="ltr">You can use your own function (in workflow) with saveentity.</div><div class="gmail_extra"><br clear="all"><div><div><br></div><div><div>Z poważaniem / Regards</div><div>Błażej Pabiszczak</div><div>M: +48.884999123<br>E: <a href="mailto:b.pabiszczak@opensaas.pl" target="_blank">b.pabiszczak@opensaas.pl</a></div></div></div>
<br><div class="gmail_quote">2014-09-18 12:09 GMT+02:00 SivaKumar J <span dir="ltr"><<a href="mailto:sivakumar.j@vtiger.com" target="_blank">sivakumar.j@vtiger.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><b>Reason:</b><br>Here, taking 2 Min's for mass editing 300 records, is not only for updating values. That is because of Events what we trigger on every record save(Mass Edit is individual $recordModel->save()). Time taken will be based on number of Events we trigger for that Module. This triggered Events include Workflows, Mod Tracker, some other module specific handlers.<br><br><b>Solution:</b><br>If we can disable those Events for Mass Edit, then we can get more than 60% of performance improvement. This is something like Import where we are not triggering those Events. This is not tough too, we just need to set a global parameter to true which will block events to trigger for Mass Edit operation.<br><br></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><div>global $VTIGER_BULK_SAVE_MODE;<br>$VTIGER_BULK_SAVE_MODE = true;<br></div></blockquote><div><br></div><div>In CRMEntity -> save($module_name, $field) function we are already checking this is, if true trigger all Events else no.<br></div><div><br></div><div><b>Why we didn't follow the above solution:</b><br></div><div>As we still want to track the changes of Mass Edit operation, we are not doing this. If we disable Events to trigger means, disabling Mod Tracker as well which will not track the change what we made in that Edit. If we don't want those changes to track then we can go with that solution which will tune up performance<br><br></div><div>Thank you<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 18, 2014 at 2:05 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">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>On 18/09/14 08:34, SIAM Translations
      wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">
        <div>
          <div dir="ltr">
            <div>Added word "temp" to description field in 300 leads. It
              took 2 min.<br>
              Can it be improved? 15s seems reasonable but in 2 min I
              drink my coffee :)</div>
            <div><br>
            </div>
            <div>Rgds</div>
            <div>Andrew Smith</div>
          </div>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
<a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a></pre>
    </blockquote>
    the issue with this (which I have come across with bulk imports) is
    that vtiger very sensibly uses transactions around the save of
    objects so that an entity saves in all the related tables or none at
    all. It starts a transaction, does the updates then commits, which
    takes a moment (0.4 seconds per entity sounds about right, including
    the modtracker updates). If you want to temporarily do some fast
    bulk stuff and you know what you are doing, then you can look in
    include/database/PearDatabase.php and break the startTransaction and
    completeTransaction methods by just getting them to instantly
    return. You can then turn autocommit off and start your own
    transaction, do lots of stuff then commit it all at once. This is
    *fast* and *dangerous*. Other things to turn off are workflow and
    modtracker. I am not quite sure how this kind of thing might be
    applied to normal mass edit, but it certainly helps for automated
    bulk data.<span><font color="#888888"><br>
    <br>
    Alan.<span class="HOEnZb"><font color="#888888"><br>
    <br>
    <pre cols="72">-- 
Libertus Solutions
<a href="http://libertus.co.uk" target="_blank">http://libertus.co.uk</a></pre>
  </font></span></font></span></div><span class="HOEnZb"><font color="#888888">

<br>_______________________________________________<br>
<a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a><br></font></span></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><br>-- <br>Regards,<br>Siva<br>Vtiger<br>
</font></span></div>
<br>_______________________________________________<br>
<a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a><br></blockquote></div><br></div>