This is a migrated thread and some comments may be shown as answers.

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

1 Answer 37 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Filipe Peixinho
Top achievements
Rank 1
Filipe Peixinho asked on 17 May 2011, 02:33 PM

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,

1 Answer, 1 is accepted

Sort by
0
Accepted
Jan Blessenohl
Telerik team
answered on 18 May 2011, 05:13 PM
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.
Tags
Development (API, general questions)
Asked by
Filipe Peixinho
Top achievements
Rank 1
Answers by
Jan Blessenohl
Telerik team
Share this question
or