In case you have your own slow SQL query, you can optimize it automatically here.
For the query above, the following recommendations will be helpful as part of the SQL tuning process.
You'll find 3 sections below:
ALTER TABLE `diagnostic` ADD INDEX `diagnostic_idx_diagnosticid` (`DiagnosticId`);
ALTER TABLE `patient` ADD INDEX `patient_idx_patientid` (`PatientId`);
ALTER TABLE `patientDiagnostic` ADD INDEX `patientdiagnostic_idx_patientid_diagnosticid` (`PatientId`,`DiagnosticId`);
ALTER TABLE `patientRoom` ADD INDEX `patientroom_idx_patientid` (`PatientId`);
SELECT
p.FirstName,
p.LastName,
d.Description,
pr.RoomNo,
pr.DateStart,
pr.DateEnd
FROM
patient p,
patientRoom pr,
diagnostic d,
patientDiagnostic pd
WHERE
p.PatientId = pd.PatientId
AND pd.PatientId = pr.PatientId
AND pd.DiagnosticId = d.DiagnosticId