Repository navigation
Various fixes - #73
Merged
Merged
Conversation
- This version uses windowing (SELECT...ROW_NUMBER() OVER) and a smaller range of UpdateTime for efficiency. - It uses a Common Table Expression (WITH...AS) for readability. - The first row for each site is then selected to give the latest values for that site. - Counting the VMs is deprecated as it's not efficient to calculate and doesn't add much for the user. Removing it here should default the value to 0 in the model.
Previous commit removes the update of this data. We're deprecating it as it doesn't add anything useful for the user at the moment and was affecting the SQL performance.
- This version uses windowing (SELECT...ROW_NUMBER() OVER) and a smaller range of UpdateTime for efficiency. - It uses a Common Table Expression (WITH...AS) for readability. - The first row for each site and submit host is then selected to give the latest values for that site/submithost combination.
These changes are similar to teh Job Records imporvements, but customised for the way these views work.
These were used during initial creation of the system to debug update times, but aren't needed in production, particularly as we use a completely different method to update the local Django database.
- Allow for future dates to be considered OK. - Add a critical threshold.
Member
Author
|
|
tofu-rocketry
force-pushed
the
various-fixes
branch
from
December 15, 2025 14:39
5b54fe4 to
82cbadb
Compare
tofu-rocketry
marked this pull request as ready for review
December 15, 2025 14:44
rowan04
reviewed
Dec 15, 2025
rowan04
left a comment
Contributor
There was a problem hiding this comment.
looks good, some very small comments
- Change last remaining CURRENT_TIMESTAMP to NOW(). - Replace DATE_SUB with plain subtraction of timestamp.
DonaldChung-HK
approved these changes
Dec 15, 2025
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.
Resolves GT-1240
Resolves #63 (by speeding up the queries to an acceptable level)
This PR does the following:
print()that were used when debugging during initial creation.Speed comparison
Before
Over 1 hour.
After
Less than 5 minutes.