You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When multiple identical updates are performed on different rows via SaveChanges, we currently generate N SQL UPDATEs:
UPDATE foo SET bar = @v1 WHERE id = @id1;
UPDATE foo SET bar = @v2 WHERE id = @id2;
UPDATE foo SET bar = @v3 WHERE id = @id3;
...
We could explore identifying such identical updates and collapsing them into a single UPDATE statements, e.g.:
UPDATE foo
SET bar = CASE
WHEN id = @id1 THEN @v1
WHEN id = @id2 THEN @v2
WHEN id = @id3 THEN @v3
...
END
WHERE"Id"IN (@id1, @id2, @id3);
We'd need to explore how this actually performs across different databases etc. This is conceptually similar to what we already do for SQL Server for insertion (where multiple INSERTs are collapsed to a single MERGE), and to #27550 for bulk deletion.
The text was updated successfully, but these errors were encountered:
When multiple identical updates are performed on different rows via SaveChanges, we currently generate N SQL UPDATEs:
We could explore identifying such identical updates and collapsing them into a single UPDATE statements, e.g.:
We'd need to explore how this actually performs across different databases etc. This is conceptually similar to what we already do for SQL Server for insertion (where multiple INSERTs are collapsed to a single MERGE), and to #27550 for bulk deletion.
The text was updated successfully, but these errors were encountered: