Very low performance when deleting items with ORM’s delete cascade in scenarios with large data amount

2 posts, 1 answers
  1. Filipe Peixinho
    Filipe Peixinho avatar
    41 posts
    Member since:
    May 2006

    Posted 17 May 2011 Link to this post

    Greetings.

     

    I am having some difficulties with ORM to delete data and I would like to know if that is a better way to optimize the operation.

    The problem I am experiencing is a very low performance when deleting items with ORM’s delete cascade in scenarios with large data amount.

    In my case, it’s a delete cascade with a depth of 4 levels and in some of these levels there are more than one property with persistent data.

    I have already take a look to ORM log file and I have noticed that ORM its making delete operations in 14 tables for each item. This operation evidence perfomance lacks.

     

    This was all working very well until the day that I have got about 1.050.000 items in the first level table, about 1.600.000 in the second, 9.000.000 in the third and 6.000 in the fourth.

     

    For the delete operation, what I’m doing is a very simple oql query and then the command scope.remove(res.ToList());

     

    Best regards,

  2. Answer
    Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 18 May 2011 Link to this post

    Hi Filipe Peixinho,
    Cascading delete means that OpenAccess loads all the data into the client first. This is done to call all the pre-delete callbacks, to update the states in the client and to clean the caches. To make it faster you might want to use server side cascading delete logic or do it in the background of your application.

    Greetings,
    Jan Blessenohl
    the Telerik team
    Q1’11 SP1 of Telerik OpenAccess is available for download; also available is the Q2'11 Roadmap for Telerik OpenAccess ORM.
  3. DevCraft banner
Back to Top