Merging Account records takes a long time and never finishes

Hi everyone

Would anyone know why is merging is not finishing? I don't understand why there are so many link requests relating to activities and if this is even important? This seems to go on for a very long time and merging never completes. 

Can anyone suggest a solution to this, please?

Thanks

  • Hi sonesay inthavong,

    Activities can add up! They are the content of the Activity Stream, and they record every audited change in every record of every module.

    You can learn a lot about this directly in the database (or through Advanced Reports):

    1. How many rows are in your activities and activities_users tables?

    SELECT COUNT(*) FROM activities;

    SELECT COUNT(*) FROM activities_users;

    2. How many rows are related to the Accounts involved in the merge?

    SELECT * FROM activities WHERE parent_type = 'Accounts' AND parent_id IN ('<accounts.id>','<accounts.id>');

    Where <accounts.id> represent the Account IDs of the accounts involved in your merger.

    If there are a lot, this could result in the errors you have described. Deleting historical activity records can greatly improve performance of your application.

    Note: When merging, multiple records across multiple modules can be effected because a merger re-relates records in other modules that are related to the account(s) deleted by the merger to now relate to the account that the other account(s) are being merged into. Merging also therefore adds activities for all of those changes.

    One way to reduce the scale of a merger is to perform the re-relating manually. Knowing which account you intend to keep, change the relations of related records before performing the merger.

    I hope this helps!

  • Thanks for the information. In the past we've purged this table before as we considered the data wan'st used. By the looks of whats in there its mostly just information about records being linked or unlink to a new record. Is there potentially anything else important in there? 

    For one GUID id I have almost 20k rows here so I cant imagine this is very useful information.

  • Hi sonesay inthavong,

    The data in this table is the content of the Activity Streams. It's importance corresponds to your use of the Activity Streams feature.

    Regarding the record with 20k changes, I recommend looking into why that record experienced so many changes in order to assess whether that is something consistent with your expectation. If it is not, it could reveal an automation loop or something similar causing undesirable changes potentially impacting performance.