EF Core's naive load-modify-save pattern causes severe performance issues at scale, allocating gigabytes of RAM and issuing one SQL statement per entity. EF Core 7+ introduced ExecuteUpdate and ExecuteDelete, which bypass the change tracker and execute a single server-side SQL statement regardless of row count. Benchmarks

13m read timeFrom woodruff.dev
Post cover image
Table of contents
The Code Every Developer Has Written and RegrettedThe Built-In Answer: ExecuteUpdate and ExecuteDeleteThe Missing Piece: There Is No ExecuteInsertEFE’s Batch Operations: UpdateFromQuery, DeleteFromQuery, InsertFromQueryBenchmarks: The Honest NumbersChoosing the Right ToolCaveats That Will Catch You Off-GuardConclusion

Sort: