-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
Question
Greetings! I'm still plugging my way through an efcore implementation for a proprietary database engine. I've made quite a lot of progress, but noticed I'm not seeing batch support happening automatically. I'm not sure this is explicit bulk insert, but rather sending multiple updates delimited by semi colon or something. I've just got a few questions on implementation of this. Article about batched updates
- Its safe to assume that batched updates as discussed above are different than the bulk insert implementations floating around, right?
- Do those batched updates handle inserts, and if so... how do people typically handle tracking insert id's for that?
- For implementing, is it a simple matter of implementing
IModificationCommandBatchFactoryto handle that? - Is there any place anyone can point me to see a reference implementation?
I've got a sample project where I'm simply trying to insert a number of records by AddRangeAsync and then calling SaveChangesAsync and they seem to run as a bunch of different queries on the same connection. For this demo project I've also configured min of 1 and max of 50 for batched statement sizes. I just don't know if batched updates are only for updates, or if they should cover inserts as well.
Thank you for your time, and any pointers you might be able to give
Your code
Stack traces
Verbose output
EF Core version
8.0.11
Database provider
Custom
Target framework
.net 8
Operating system
Windows 11
IDE
Visual Studio 2022