I have a query with a number of LEFT JOIN's in it - SELECT DISTINCT equip.*,CONCAT_WS (' ',firstname,lastname) as name,rooms.rmdesc FROM equip LEFT JOIN stfeqlink ON stfeqlink.equipid = equip.autoid AND stfeqlink.datereturned IS NULL AND equip.dept = 'SW'LEFT JOIN staff ON stfeqlink.staffid = staff.id AND stfeqlink.datereturned IS NULL LEFT JOIN rooms ON rooms.rmid = stfeqlink.room GROUP BY equip.autoid DESC ORDER BY equip.model,equip.serial;
The query works fine but is incredibly slow. The DISTINCT is not the problem. Does anyone have ANY IDEAS to get around the slow running of such a query.
The query works fine but is incredibly slow. The DISTINCT is not the problem. Does anyone have ANY IDEAS to get around the slow running of such a query.