Skip to content

Commit

Permalink
[imaging_browser] Fix inefficient query for first acquisition date (#…
Browse files Browse the repository at this point in the history
…6871)

The mri_acquisition_date table dropped in LORIS 22.0, and replaced by
a JOIN to the `parameter_file` table in order to look up the header
directly. However, ths query is missing a clause to restrict it to
only look up the `acquisition_date` header, resulting in an
unconditional join to `parameter_file`. Due to the size of the table
in existing projects, this can make the imaging browser menu page
take minutes to load.

This adds a where clause to restrict it to joining the `acquisition_date`
header, making the load time of the module usable again.
  • Loading branch information
driusan committed Aug 5, 2020
1 parent 8a877df commit d2901e4
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ class ImagingBrowserRowProvisioner extends \LORIS\Data\Provisioners\DBRowProvisi
$left_joins
WHERE
s.Active = 'Y' AND
f.FileType='mnc'
f.FileType='mnc' AND
pt.Name='acquisition_date'
GROUP BY s.ID
ORDER BY c.PSCID, s.Visit_label
",
Expand Down

0 comments on commit d2901e4

Please # to comment.