-
Notifications
You must be signed in to change notification settings - Fork 53
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
chore: Better postgres duplicate insert #2535
Conversation
This PR may contain changes to database schema of one of the drivers. If you are introducing any changes to the schema, make sure the upgrade from the latest release to this change passes without any errors/issues. Please make sure the label |
You can find the image built from this PR at
Built from 54a6012 |
The insert does not fail when duplicate, it returns a positive response when doing 'put' of a duplicated row. The test is adapted so that we just check that the number of messages doesn't grow after trying to add a duplicated row.
e07e955
to
1ff0085
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its great!!!! Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the DB no longer show warnings about duplicates?
Correct |
Description
This PR implements a suggestion
After comparing insertion times with ~30.000 samples, within the
archive
module, these are the avg insert times:Then, this solution makes it even smoother the insertion. Thanks for such a suggestion @jakubgs !
Changes
ON CONFLICT DO NOTHING;
in the insert statementHow to test
source env.sh
nim c -r -d:chronicles_log_level=DEBUG -d:release -d:postgres -d:rln --passL:librln_v0.3.4.a --passL:-lm -d:nimDebugDlOpen ./tests/waku_archive/test_driver_postgres.nim
Issue
closes #2526
closes status-im/infra-status#26