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

fix: improve create client performance #337

Merged
merged 6 commits into from
May 21, 2024

Conversation

chris13524
Copy link
Member

@chris13524 chris13524 commented May 20, 2024

Description

Currently we are deleting and re-inserting the record, and it turns out the delete operation is quite expensive compared to the insert. Refactoring the queries to only do the operations necessary: insert or update while still locking the record for update.

Slack conversation

How Has This Been Tested?

Not tested

Due Diligence

  • Breaking change
  • Requires a documentation update
  • Requires a e2e/integration test update

@chris13524 chris13524 self-assigned this May 20, 2024
@arein arein added the accepted The issue has been accepted into the project label May 20, 2024
@nopestack
Copy link

Currently we are deleting and re-inserting the record
Interesting decision. Was there a particular reason this way implemented that way?

@chris13524
Copy link
Member Author

Interesting decision. Was there a particular reason this way implemented that way?

It was the culmination of multiple iterations of new queries not susceptible to concurrency errors. I think we went with DELETE because it was easier than handling all of the insert or update cases (of which this PR now implements directly).

Copy link
Contributor

@geekbrother geekbrother left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks! One comment: did we miss the transaction between select and updates?

@chris13524 chris13524 merged commit 0481f50 into main May 21, 2024
6 checks passed
@chris13524 chris13524 deleted the fix/create-client-performance branch May 21, 2024 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted The issue has been accepted into the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants