Do you bulk process in chunks?

Last updated by Brady Stroud [SSW] about 2 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
}
Bryden Oliver
We open source. Powered by GitHub