-
Notifications
You must be signed in to change notification settings - Fork 70
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
Slow performance with multiple rows to insert #175
Comments
Just from reading our code and the SQLAlchemy docs on Removing the line causes almost all of our test case to fail - so I bet at least something will be seriously broken. We could try to move it outside that loop though... |
Thanks for the quick answer! Pardon my ignorance here, but I just wonder could The idea about moving the commit out of the loop could be helpful for my use case I suppose, but not sure if everything would still work as intended then? |
I think that's still not really persisting any data (possibly depending on the database). For the difference between
At least it breaks less test cases than removing the line entirely ;). If you have time to investigate further, I'd appreciate it! |
Ok, thanks for that link, it explains it perfectly! :) I might "investigate" a bit, the first thing which comes to my mind would be to be able to pass a parameter to that function which would skip committing if user wants to (e.g. However, I'll have to fix a ton of other things first since I've been a bit inactive and after updating Eve-SQLAlchemy my tests are screaming with tons of errors... :) |
I have noticed that sending multiple "documents" for inserting (tried with 300-400 documents) takes very long time, in my case, it was around 2.5 minutes. All of the data is sent in a single request with an array of documents in request body.
Trying to find a bottleneck in my app, I have noticed that commenting out a line responsible for committing the data made everything blazingly fast, so I left it that way for the time being even though I'm not sure about possible consequences yet.
I wonder if that line really is necessary? If so, why is it so? And what could possibly go wrong if I leave it commented out?
Thanks!
The text was updated successfully, but these errors were encountered: