Home > Mobile >  How to improve slow query performance?
How to improve slow query performance?

Time:02-02

I have a multi-join query that targeting the hospital's chart database.

this takes 5~10 seconds or more.

This is the visual expain using mysql workbench. enter image description here

The query is below.

select sc.CLIENT_ID as 'guardianId', sp.PET_ID as 'patientId', sp.NAME as 'petName'
, (select BW from syn_vital where HOSPITAL_ID = sp.HOSPITAL_ID and PET_ID = sp.PET_ID order by DATE, TIME desc limit 1) as 'weight'
, sp.BIRTH as 'birth', sp.RFID as 'regNo', sp.BREED as 'vName'
, (case when ss.NAME like '           
  • Related