Entity Framework Gotcha
If you want to migrate a lot of data which means running updates to existing rows, it is 100X faster to first change the objects then run a single save changes call, instead of doing row by row call.
Also, when batching such operations say by 5000 rows, re-initialize the entities object each time, otherwise it will cache everything progressively getting slower over time.
Also, when batching such operations say by 5000 rows, re-initialize the entities object each time, otherwise it will cache everything progressively getting slower over time.
Comments
Post a Comment