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

satellite/accounting: Performance improvements to getNodeIds used by GetBandwidthSince #4009

Merged
merged 3 commits into from
Dec 21, 2020

Conversation

ethanadams
Copy link
Collaborator

@ethanadams ethanadams commented Dec 21, 2020

Change-Id: Ie94827697181c3bfe51c869460e5d0e2a1f50902

What:
Get distinct node IDs from storagenode_bandwidth_rollups since the last rollup timestamp, instead of from all rollups

Why:
The current query can take over 2 minutes on CRDB. This change makes it less than 1 second.

Please describe the tests:

  • Test 1: Existing tests.
  • Test 2:

Please describe the performance impact:

Code Review Checklist (to be filled out by reviewer)

  • NEW: Are there any Satellite database migrations? Are they forwards and backwards compatible?
  • Does the PR describe what changes are being made?
  • Does the PR describe why the changes are being made?
  • Does the code follow our style guide?
  • Does the code follow our testing guide?
  • Is the PR appropriately sized? (If it could be broken into smaller PRs it should be)
  • Does the new code have enough tests? (every PR should have tests or justification otherwise. Bug-fix PRs especially)
  • Does the new code have enough documentation that answers "how do I use it?" and "what does it do?"? (both source documentation and higher level, diagrams?)
  • Does any documentation need updating?
  • Do the database access patterns make sense?

Change-Id: Ie94827697181c3bfe51c869460e5d0e2a1f50902
@ethanadams ethanadams added the Request Code Review Code review requested label Dec 21, 2020
@cla-bot cla-bot bot added the cla-signed label Dec 21, 2020
@ghost ghost removed their request for review December 21, 2020 15:01
ifraixedes
ifraixedes previously approved these changes Dec 21, 2020
@ifraixedes ifraixedes self-requested a review December 21, 2020 15:08
Add IF NOT EXISTS to index creation

Change-Id: Ieb9fedfd8b4d58247851acea96a557d922a3e1f1
@stefanbenten stefanbenten changed the title satellite/accounting:Performance improvements to getNodeIds used by GetBandwidthSince satellite/accounting: Performance improvements to getNodeIds used by GetBandwidthSince Dec 21, 2020
@stefanbenten stefanbenten merged commit 6e50189 into master Dec 21, 2020
@stefanbenten stefanbenten deleted the sn_band_rollups_index branch December 21, 2020 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants