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.
Related to the Slack discussion:
https://concord-consortium.slack.com/archives/C0M5CM1RA/p1711115781067969
There will be more changes in this controller, but I just wanted to double-check if the concept is correct.
classes_query
is the only query that explicitly applies filters. That's the "output".Remaining queries:
teacher_query
,cohorts_query
andrunnables_query
acceptclasses_ids_subquery
and don't apply filter values explicitly. @scytacki, I understand that this is what you meant by subqueries, right?This means that we'll usually execute 4 DB queries.
I could see another option. We could modify the final processing of classes to something like this:
(ofc we probably shouldn't use arrays to deal with duplicates, etc., but it's just a general idea)
It would be just one explicit query execution (for classes), but I guess collecting teachers, runnables, and cohorts from each class could actually trigger lots of additional queries for each class, right? Or do I miss a third way to approach it?