2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

Fixed issue: Questionnaire outcomes page slow with many shifts

This commit is contained in:
Adam Zammit
2017-11-23 12:23:51 +11:00
parent f2149d4cdf
commit 118be0bb45
2 changed files with 4 additions and 1 deletions

View File

@@ -288,6 +288,7 @@ group by s.import_id";
WHERE a.outcome_id = '10'
AND a.case_id = b.case_id
AND b.questionnaire_id = '$questionnaire_id'
AND b.questionnaire_id = sh.questionnaire_id
AND sh.start <= a.start
AND sh.end >= a.start
GROUP BY sh.shift_id) as c on (s.shift_id = c.shift_id)

View File

@@ -1562,7 +1562,9 @@ CREATE TABLE `shift` (
`start` datetime NOT NULL,
`end` datetime NOT NULL,
PRIMARY KEY (`shift_id`),
KEY `questionnaire_id` (`questionnaire_id`)
KEY `questionnaire_id` (`questionnaire_id`),
KEY `start` (`start`),
KEY `end` (`end`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------