Skip to content

New efcore provider: Implementing batched update support #35512

@ronnyek

Description

@ronnyek

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

  1. Its safe to assume that batched updates as discussed above are different than the bulk insert implementations floating around, right?
  2. Do those batched updates handle inserts, and if so... how do people typically handle tracking insert id's for that?
  3. For implementing, is it a simple matter of implementing IModificationCommandBatchFactory to handle that?
  4. 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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions