Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • croban 25 posts 96 karma points
    Feb 09, 2016 @ 09:10
    croban
    0

    Bulk Delete Operation

    I have to delete more the 1000 Items (Nodes without children). I have tried to do it with

    for (int i = 0; i < items.Count; i++)
    {
        UmbracoApplicationContext.Services.ContentService.Delete(items[i]);
    }
    

    I have tried also to delete all content of specified ContentType

    UmbracoApplicationContext.Services.ContentService.DeleteContentOfType(1234)
    

    Both methods are realy slow.

    First method (foreach) do a Job for 100 Items in 47sec, next round takes a 59sec, next round takes 190sec. After fifth round you don't want to wait that the operation finish.

    Second method have the same problem, after some time it takes more than 10sec to delete an Item.

    Is there some better method doing it? I have also tried BulkManager, and this tool have the same problem. ExecutionTimeout is set inside web.config. Application is build with "release" configurations.

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Feb 10, 2016 @ 14:23
    Jeroen Breuer
    0

    Hello,

    Deleting is always slow, but I'm not sure if it should get slower. You could try to report an issue here: http://issues.umbraco.org/newissue

    Jeroen

  • croban 25 posts 96 karma points
    Feb 12, 2016 @ 09:23
    croban
    0

    Hi

    I have executed delete method without debugging it. Execution time (written in log) stay constant and deletes approximately 3 nodes per second.

    Obviously some weird magic happens when I'm deleting and debugging the solution in the same time.

    I'm still not happy with the performance but I can live with it. Some kind of Bulk Create/Delete/Insert methods would be great.

Please Sign in or register to post replies

Write your reply to:

Draft