In my ASP.NET application I am using Entity Framework 6 with SQL Server. As per my scenario I need to perform a bulk update (40k row at a time) and bulk delete operation (40k row at a time) with EF6. EF6's RemoveRange
method seems very very slow and update takes forever. Is there any way to speed this up?
Asked
Active
Viewed 314 times
0
-
Use a bulk update library `¯\_(ツ)_/¯` – TheGeneral Dec 02 '20 at 04:58
-
is it free for production? – robert Dec 02 '20 at 05:05
-
There are a fair few libraries around, and more then one way to achieve this, and yeah there are free versions. Is this for Core or Framework ? – TheGeneral Dec 02 '20 at 05:06
-
https://entityframework-extensions.net/bulk-insert – jtabuloc Dec 02 '20 at 05:09
-
its asp.net mvc. Not CORE. Can you suggest some of the available options? – robert Dec 02 '20 at 05:09
-
I am aware of bulkInsert, thats for insert operation. not for update – robert Dec 02 '20 at 05:10
1 Answers
0
you should try a stored procedure to delete the items, stored procedures are much faster and pre-compiled form stored in SQL Server.
for reference to work with Stored Procedure please visit the link. Stored Procedure with Entity Framework
-
-
That's one way, but OP is seeking _"...I need to perform bulk update(40k row at a time)"_ too – Dec 02 '20 at 05:16