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

refactor: optimize cache-transactions command #932

Merged
merged 3 commits into from
Sep 23, 2021

Conversation

alfonsobries
Copy link
Member

Summary

Optimizes the job by:

  1. Getting only the data we need from the query (time + count)
  2. format the data in the query to avoid unnecessary loops

Note: The AllAggregate gives slightly different results, this is because the old version wasn't using the AT TIME ZONE 'UTC' modifier when formatting the date on the query so the old one was incorrect (unless this was is correct and the rest were wrong and I am missing something ). Full query select as reference to_char(to_timestamp(%d+timestamp) AT TIME ZONE 'UTC', '%s') as formated_date

To test

  • Run the command, ensure the data is the same than the original by comparing dev branch
  • I personally tested by storing and comparing the result from dev branch to this and running an array_diff

before

image

after

image

Checklist

  • I checked my UI changes against the design and there are no notable differences
  • I checked my UI changes for any responsiveness issues
  • I checked my UI changes in light AND dark mode
  • I checked my (code) changes for obvious issues, debug statements and commented code
  • I opened a corresponding card on Clickup for any remaining TODOs in my code
  • I added a short description on how to test this PR (if necessary)
  • Documentation (if necessary)
  • Tests (if necessary)
  • Ready to be merged

@ItsANameToo ItsANameToo merged commit ad1d15d into develop Sep 23, 2021
@ItsANameToo ItsANameToo deleted the refactor/optimize-cache-transactions branch September 23, 2021 19:06
@ItsANameToo
Copy link
Member

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

Successfully merging this pull request may close these issues.

None yet

2 participants