[Vtigercrm-developers] mass edit performance

Pabiszczak, Błażej b.pabiszczak at opensaas.pl
Thu Sep 18 10:16:45 GMT 2014


You can use your own function (in workflow) with saveentity.


Z poważaniem / Regards
Błażej Pabiszczak
M: +48.884999123
E: b.pabiszczak at opensaas.pl

2014-09-18 12:09 GMT+02:00 SivaKumar J <sivakumar.j at vtiger.com>:

> *Reason:*
> 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.
>
> *Solution:*
> 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.
>
> global $VTIGER_BULK_SAVE_MODE;
>> $VTIGER_BULK_SAVE_MODE = true;
>>
>
> In CRMEntity -> save($module_name, $field) function we are already
> checking this is, if true trigger all Events else no.
>
> *Why we didn't follow the above solution:*
> 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
>
> Thank you
>
> On Thu, Sep 18, 2014 at 2:05 PM, Alan Bell <alan.bell at libertus.co.uk>
> wrote:
>
>>  On 18/09/14 08:34, SIAM Translations wrote:
>>
>>   Added word "temp" to description field in 300 leads. It took 2 min.
>> Can it be improved? 15s seems reasonable but in 2 min I drink my coffee :)
>>
>>  Rgds
>> Andrew Smith
>>
>>
>> _______________________________________________http://www.vtiger.com/
>>
>>  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.
>>
>> Alan.
>>
>> --
>> Libertus Solutionshttp://libertus.co.uk
>>
>>
>> _______________________________________________
>> http://www.vtiger.com/
>>
>
>
>
> --
> Regards,
> Siva
> Vtiger
>
> _______________________________________________
> http://www.vtiger.com/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20140918/520fb98d/attachment.html>


More information about the vtigercrm-developers mailing list