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

dapper batch update or insert is particularly slow #1441

Open
XuLinFei opened this issue Apr 27, 2020 · 3 comments
Open

dapper batch update or insert is particularly slow #1441

XuLinFei opened this issue Apr 27, 2020 · 3 comments

Comments

@XuLinFei
Copy link

dapper batch update or insert is particularly slow

@mgravell
Copy link
Member

Do you have any example code, time taken, and data volume, for context?

@rickyzu
Copy link

rickyzu commented Mar 5, 2021

We had a similar issue recently with Dapper v2.0.78 and .Net5. We were simply trying to update 100 rows with some new data (6 or 7 columns per row). It took around 8.5 minutes running locally via visual studio. I amended the code to use Dapper.Contrib and encountered similar issues.

I eventually used Entity framework for all Inserts and Updates (update time was under a few seconds) and Dapper for MultiResult Reader.

@paaaz
Copy link

paaaz commented Aug 16, 2021

The problem why inserting/updating takes so long is described in #1071

A solution would be to modify the insert statement by expanding the "VALUES" part for each element in the collection instead of sending a single command to the DB for each element

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants