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

Adding get_balance() database function #126

Merged
merged 8 commits into from
Jun 30, 2024
Merged

Conversation

adamcharnock
Copy link
Owner

@adamcharnock adamcharnock commented Jun 27, 2024

postgres.public> select get_balance(7)
[2024-06-28 20:25:18] 1 row retrieved starting from 1 in 430 ms (execution: 420 ms, fetching: 10 ms)

That 420ms for an account with 1 million legs.

This is on an M2 Macbook. Also, if I just calculate the balance for the one account (not including children) then it shaves about 30-40% off the execution time. This is a decent win, but I think we'll get bigger gains from adding running totals as per #76.

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 98.18182% with 1 line in your changes missing coverage. Please review.

Project coverage is 92.02%. Comparing base (81b90df) to head (d9f9071).
Report is 38 commits behind head on master.

Files Patch % Lines
hordak/utilities/db_functions.py 95.65% 0 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #126      +/-   ##
==========================================
- Coverage   93.01%   92.02%   -0.99%     
==========================================
  Files          59       66       +7     
  Lines        3836     4238     +402     
  Branches      249      274      +25     
==========================================
+ Hits         3568     3900     +332     
- Misses        224      284      +60     
- Partials       44       54      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@adamcharnock adamcharnock merged commit 2061645 into master Jun 30, 2024
23 checks passed
@adamcharnock adamcharnock added this to the 2.0 milestone Jun 30, 2024
@nitsujri nitsujri mentioned this pull request Jul 1, 2024
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.

2 participants