I Loaded 8,956 Rows to Flip One Boolean

TL;DR AI
2 min readKey summary
In EF Core, archiving 8,956 delivered orders by loading entities, flipping a flag, and saving issued 8,957 SQL commands and took about 355 ms with 75 MB of allocations.
The same work with ExecuteUpdate completed in one SQL command, about 10.6 ms, and just 68 KB of allocations.
The benchmark shows how row-by-row load-modify-save can be dramatically slower and heavier than a set-based update.
One caveat: ExecuteUpdate bypasses the change tracker, so tracked entities can become stale.
