[dataquery] Fetch accessible instruments in a single query in the dictionary module - #11167
Open
HenriRabalais wants to merge 1 commit into
Open
HenriRabalais wants to merge 1 commit into
HenriRabalais wants to merge 1 commit into
Conversation
HenriRabalais
force-pushed
the
dataquery-dictionary-visit-query-perf
branch
from
August 10, 2026 23:24
667b993 to
429e3fc
Compare
HenriRabalais
force-pushed
the
dataquery-dictionary-visit-query-perf
branch
from
August 11, 2026 10:09
429e3fc to
32fa8b6
Compare
Collaborator
Author
|
@marandmart can you take a look at this when you have the time? |
Collaborator
|
@HenriRabalais can you please rebase this to 29.0-release |
Move the per-visit instrument lookup out of the dictionary module and into a batched Utility::getVisitsInstruments() helper that fetches the distinct instruments for all of the users visits in one query, instead of running Utility::getVisitInstruments() once per visit label.
HenriRabalais
force-pushed
the
dataquery-dictionary-visit-query-perf
branch
from
August 19, 2026 12:50
32fa8b6 to
babdda2
Compare
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
/dictionary/categories(and/dictionary/module/<name>) scaled linearly with the number of distinct visit labels in the database.getUserModuleCategories()built the set of instruments the user can access by running oneUtility::getVisitInstruments()query per visit label, and each of those queries joinssession,candidate,flagandtest_names.This replaces the per-visit loop with a single query that fetches the distinct instruments across all of the user's visits.
Changes
foreachloop inLORIS\dictionary\Module::getUserModuleCategories()with a single query over all of the user's visitsTesting Instructions
session.Visit_labelvalues.GET /dictionary/categoriesdirectly.Related Issues
Closes #11166. The slow loop was introduced in #9903.