dotnet / efcore

EF Core is a modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations.
https://docs.microsoft.com/ef/
MIT License
13.68k stars 3.17k forks source link

Use the new batching API from ADO.NET #18990

Open ajcvickers opened 4 years ago

ajcvickers commented 4 years ago

Once it is in and there is an implementation for SQL Server, SQLite, Npgsql, and MySQL.

See https://github.com/dotnet/corefx/issues/35135

maulik-modi commented 3 years ago

@ajcvickers or @roji , Whats your thoughts about 4X performance boost with third party API such as BulkExtensions over AddRange and SaveChanges https://dotnetfiddle.net/ttbri7?

Is there any option we can tune in EF Core 5 for bulk insert instead of adding a dependency on Third party API?

roji commented 3 years ago

@maulik-modi bulk insert/update is unrelated to this issue, you're probably looking for https://github.com/dotnet/efcore/issues/15059.

ajcvickers commented 2 years ago

Take #7172 into account when implementing this.

IT-CASADO commented 2 years ago

Found a new issue with MERGE statement in a constellation with TEMPORAL TABLE, COLUMNSTORE INDEX and NON-CLUSTERED INDEXES:

https://dba.stackexchange.com/questions/313569/why-merge-doesnt-insert-more-than-277-records-into-a-table-which-is-configured

But here I don't get any SQL Server error, but an Entity Framework error:

image

But this error appears currently ONLY in SQL Azure Databases. Yes, i know! From the point-of-view of EF Core this is correct ;)

roji commented 2 years ago

@IT-CASADO please open a new issue with a runnable, self-contained EF Core repro - the SO above contains SQL code which isn't generated by EF Core (e.g. MERGE with a SELECT TOP subquery).

IT-CASADO commented 2 years ago

I created a new issue: #28281