Skip to content

Conversation

bjester
Copy link
Member

@bjester bjester commented Aug 4, 2025

Summary

Reduced the complexity of the query slightly by using an EXISTS clause instead of IN. In explaining the query, the runtime was cut in half and it appears the query plan is slightly better by avoiding hash buckets. It also seems that a runtime decision is made to further improve the query over its chosen plan, as it (never executed) a portion of the query, which gives further confidence the query planner has enough flexibility to chose a quicker execution plan.

Additionally, some semi-related storage calculation methods were marked as deprecated, as well as the endpoint where they're used, their only usage and a no longer used API by ricecooker.

References

closes #5069

Reviewer guidance

  • See passing action check on first commit, where tests were added
  • Tests pass after change

@bjester bjester changed the title Add regression tests for User.check_channel_space Improve query that checks storage space before channel deploy Aug 4, 2025
@bjester bjester marked this pull request as ready for review August 4, 2025 20:16
@AlexVelezLl AlexVelezLl self-assigned this Aug 13, 2025
Copy link
Member

@AlexVelezLl AlexVelezLl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes makes sense. The new staging files query seems to be equivalent to the previous one, and the new resulting query appears to be more flexible now. lgtm!

@bjester bjester merged commit 417c7a1 into learningequality:unstable Aug 13, 2025
14 checks passed
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.

Optimize user file size calculation query
3 participants