Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Dashboard] Fix study progression performance #5887

Merged
merged 3 commits into from
Jan 6, 2020

Conversation

driusan
Copy link
Collaborator

@driusan driusan commented Dec 24, 2019

For long running studies the "study progression" widget on the
dashboard was doing an excessive number of queries on the database
(one per site per month of the study having been running) which
was causing the dashboard to take an excessive amount of time to
load.

This replaces it with a single query using a GROUP BY, and then
massages the data in PHP to the same format.

To test this compare the dashboard/ajax/get_scan_line_data.php results
before and after this change. The JSON returned should be identical, but the
performance should be faster (if there's a large enough amount of data
that the before was noticeably slow to load.).

For long running studies the "study progression" widget on the
dashboard was doing an excessive number of queries on the database
(one per site per month of the study having been running) which
was causing the dashboard to take an excessive amount of time to
load.

This replaces it with a single query using a GROUP BY, and then
massages the data in PHP to the same format.
@driusan
Copy link
Collaborator Author

driusan commented Dec 24, 2019

(Note: get_recruitment_line_data probably should get a similar treatment, but the query on that one isn't quite as expensive so it takes seconds instead of minutes to run on my sandbox.)

@driusan driusan merged commit f8cd40a into aces:master Jan 6, 2020
lingma pushed a commit to lingma/Loris that referenced this pull request Jan 6, 2020
For long running studies the "study progression" widget on the
dashboard was doing an excessive number of queries on the database
(one per site per month of the study having been running) which
was causing the dashboard to take an excessive amount of time to
load.

This replaces it with a single query using a GROUP BY, and then
massages the data in PHP to the same format.
@ridz1208 ridz1208 added this to the 23.0.0 milestone Jan 7, 2020
@ridz1208 ridz1208 added the Add to Release Notes PR change should be highlighted in Release notes (important security, features and bugfixes) label Jan 31, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Add to Release Notes PR change should be highlighted in Release notes (important security, features and bugfixes)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants