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

before_commit_from_insert actually issues UPDATE command following the INSERT command #2

Open
mmangione opened this issue Mar 24, 2023 · 1 comment

Comments

@mmangione
Copy link

mmangione commented Mar 24, 2023

It would seem to me if the before_commit_from_insert command is used we should be operating on an object pre-commit, then committing it. So, that would be equivalent to operating on the object, making updates, the inserting the updated object through the INSERT command. That is not what is happening. The INSERT command is putting the object in the database and then an UPDATE command is issued with the updated content from the before_commit_from_insert command.

@mmangione
Copy link
Author

mmangione commented Mar 24, 2023

We were inserting about 25M records in 25,000 record increments. It was taking 630s/batch - so our process was taking days. I then switched to a custom method that simply operates on the object prior to a standard commit and it was taking 21s/batch. So, it was a pretty stark difference.

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

No branches or pull requests

1 participant