Do you bulk process in chunks?

Last updated by Brook Jeynes [SSW] 8 months ago.See history

Databases are slow at doing bulk updates. It's generally significantly faster to break bulk processing down into manageable chunks. It also avoids other database users experiencing significant blocking issues.

Linq include the Chunk method to make this process nice and easy.

var productIds = context.ProductIds;
foreach(var chunk in productIds.Chunk(10))
{
    // Do stuff
}
We open source. Powered by GitHub