Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PERF: Investigate optimized rows affected round-tripping when batching #7038

Closed
anpete opened this issue Nov 17, 2016 · 3 comments
Closed

PERF: Investigate optimized rows affected round-tripping when batching #7038

anpete opened this issue Nov 17, 2016 · 3 comments
Assignees
Labels
closed-no-further-action The issue is closed and no further action is planned. punted-for-2.0

Comments

@anpete
Copy link
Contributor

anpete commented Nov 17, 2016

We currently do this kind of thing:

UPDATE [world] SET [randomnumber] = @p0
WHERE [id] = @p1;
SELECT @@ROWCOUNT;

UPDATE [world] SET [randomnumber] = @p2
WHERE [id] = @p3;
SELECT @@ROWCOUNT;

UPDATE [world] SET [randomnumber] = @p4
WHERE [id] = @p5;
SELECT @@ROWCOUNT;

This approach means we have to call NextResult for each statement. We should see if there is faster way, perhaps involving just a single reader MoveNext.

@ajcvickers
Copy link
Contributor

We should check that there is real benefit if we decide to pursue this.

@AndriySvyryd
Copy link
Member

Also, we don't even need this for inserts

@ajcvickers ajcvickers assigned roji and unassigned AndriySvyryd Nov 5, 2021
@ajcvickers ajcvickers added this to the 7.0.0 milestone Nov 5, 2021
@roji
Copy link
Member

roji commented Mar 18, 2022

For deletions, we have design for bulk delete which would return the IDs of deleted rows in a single resultset (#27550 (comment)).
For insertions this isn't necessary (rows are either inserted, or an error occurs)

For updates, we may be able to use MERGE for bulk updates on SQL Server - benchmark this.

Note that since #27547, we no longer do a separate query for concurrency checking, but use a RETURNING/OUTPUT clause. That still generates a resultset per change.

@ajcvickers ajcvickers removed this from the 7.0.0 milestone Apr 23, 2022
@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-no-further-action The issue is closed and no further action is planned. punted-for-2.0
Projects
None yet
Development

No branches or pull requests

5 participants