-
Notifications
You must be signed in to change notification settings - Fork 356
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
perf: improve resource agg performance #8735
Conversation
✅ Deploy Preview for determined-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8735 +/- ##
==========================================
+ Coverage 47.70% 47.72% +0.01%
==========================================
Files 1049 1049
Lines 167250 167250
Branches 2241 2242 +1
==========================================
+ Hits 79792 79812 +20
+ Misses 87300 87280 -20
Partials 158 158
Flags with carried forward coverage won't be shown. Click here to find out more. |
Post query plan on large db
|
old query plan
|
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.
looks good, just a question about the sum of seconds
), | ||
-- We divide by count since we have multiple rows with the same total. | ||
(SUM(ra_total.seconds) FILTER (WHERE ra_total.aggregation_key IS NOT NULL) / | ||
COUNT(*) FILTER (WHERE ra_total.aggregation_key IS NOT NULL)) AS seconds, |
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.
question: are the rows always guaranteed to have the same second values?
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.
Yeah they always will, but I think there was some awkwardness in the LEFT JOIN method, I changed my mind and decided to rewrite the query and use the same method as the original but making sure index scans happen
new strategy query plan
|
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.
Not super familiar with query planning, but from what I can tell it looks good!
8f32bff
to
1bd2edb
Compare
Description
Improve resource aggregation daily performance.
Test Plan
Integration test should cover it.
Commentary (optional)
Checklist
docs/release-notes/
.See Release Note for details.
Ticket