dotConnect for Snowflake executes each INSERT, UPDATE, and DELETE statement generated by SaveChanges as a separate request. This topic describes how to modify multiple rows efficiently and how to reduce the cost of queries.
To update or delete multiple rows efficiently, use the ExecuteUpdate and ExecuteDelete methods. They are available in the provider builds for Entity Framework Core 8 and later. Each method translates the operation into a single UPDATE or DELETE statement without loading entities into memory or using the change tracker:
A filter by a navigation property, as in the second statement, is translated to a subquery: DELETE ... WHERE "Id" IN (SELECT ... JOIN ...). ExecuteUpdate can also assign JSON text to a VARIANT, OBJECT, or ARRAY column.
The ExecuteUpdate and ExecuteDelete methods execute immediately, without calling SaveChanges. They don't update tracked entities and don't apply optimistic concurrency control. Don't mix them with changes to the same rows that you save with SaveChanges: otherwise, SaveChanges can overwrite the changes made by these methods.
Select(p => new { p.Name, p.Price }). This can reduce the amount of data Snowflake scans and transfers.For general performance recommendations, see Performance Optimization.