Optimize raw data job queries.#1780
Merged
aaronweeden merged 1 commit intoubccr:xdmod11.0from Dec 14, 2023
Merged
Conversation
This was referenced Sep 20, 2023
5c0e330 to
a03a932
Compare
a03a932 to
fc9c13e
Compare
df4badf to
6e0faf3
Compare
6e0faf3 to
f1d789b
Compare
This was referenced Nov 21, 2023
46c1389 to
9948af7
Compare
eiffel777
reviewed
Dec 8, 2023
Comment on lines
+124
to
+118
| } else { | ||
| $this->addPdoWhereCondition( | ||
| new WhereCondition( | ||
| new TableField($factTable, 'end_time_ts'), | ||
| '>=', | ||
| $startDateTs | ||
| ) | ||
| ); | ||
| $this->addPdoWhereCondition( | ||
| new WhereCondition( | ||
| new TableField($factTable, 'end_time_ts'), | ||
| '<=', | ||
| $endDateTs | ||
| ) | ||
| ); | ||
| } |
Contributor
There was a problem hiding this comment.
Is there a reason why either the day_id or end_day_id field wouldn't be better for multiple day queries as well?
Contributor
Author
There was a problem hiding this comment.
Good idea, I have changed it to use end_day_id.
9b0c253 to
82c5429
Compare
eiffel777
approved these changes
Dec 14, 2023
Co-Authored-By: Joe White <jpwhite4@buffalo.edu>
82c5429 to
5ad42fc
Compare
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR optimizes raw data queries in the Jobs realm by using
WHEREconditions on theend_day_idfield ofmodw.job_tasksinstead of theend_time_tsfield. This PR also removes theDISTINCTmodifier for single-day queries.There are also PRs for https://github.com/ubccr/xdmod-xsede/pull/433 and https://github.com/ubccr/xdmod-xsede/pull/448.
Motivation and Context
The new query is much faster (<10 seconds per single-day query compared to ~200 seconds), and in conjunction with #1792 and ubccr/xdmod-data#19, it makes the data analytics framework more responsive.
Tests performed
In addition to ensuring the regression tests from #1788 still pass:
--timeargument.'new': 'https://xdmod-dev.ccr.xdmod.org'since https://github.com/ubccr/xdmod-xsede/pull/433 is already merged.'old': 'https://xdmod-dev.ccr.xdmod.org:9001'with the version ofclasses/DataWarehouse/Query/Jobs/JobDataset.phpfrom Use the portal's time zone for raw data query dates instead of UTC. #1779.--timeargument and the variableNUM_DAYS_PER_REQUESTset to 1:Checklist: