-
Notifications
You must be signed in to change notification settings - Fork 4
[PB-2394] feat: switch to incrementally calculated usage #671
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
base: master
Are you sure you want to change the base?
Conversation
…current /usage endpoint is hit
…tUserUsedStorageIncrementally
fa4c786
to
2490bae
Compare
2490bae
to
154069f
Compare
WHERE | ||
type = 'yearly' | ||
AND user_id = :userUuid | ||
GROUP BY |
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.
Why are you grouping by year if it is a yearly record? The record itself is an aggregation. Am I missing something?
type = 'monthly' | ||
AND user_id = :userUuid | ||
GROUP BY | ||
date_trunc('year', period), date_trunc('month', period) |
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.
Same question here
type = 'monthly' | ||
AND user_id = :userUuid | ||
GROUP BY | ||
date_trunc('year', period), date_trunc('month', period) |
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.
Same question here
type = 'daily' | ||
AND user_id = :userUuid | ||
GROUP BY | ||
date_trunc('year', period), date_trunc('month', period) |
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.
And here, regarding to the year
57684dc
to
c843619
Compare
|
This PR is stale because it has been open for more than 15 days with no activity. |
Branch off: #668
The original branch just started saving the file sizes delta in the
usages
table. This PR implements the aggregation of all the records inusages
to calculate the current usage.The target branch is set to feat/incremental-usage-1 for the time being just to show the differences between the branches, but this PR should point to master when feat/incremental-usage-1 gets merged.
You can check the performance of the aggregation, here it is the raw query: