Hi
Can anyone help me with this problem.
Whenever I create a query with a number of left joins they can take up to 30 seconds to run on a web based MySQL database running through Apache.
The latest query to cause me grief is shown below:
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 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.autoid;
The query works fine in that I get the result I want but it is taking way to long to give me the result.
Any help at all would be REALLY appreciated.
Can anyone help me with this problem.
Whenever I create a query with a number of left joins they can take up to 30 seconds to run on a web based MySQL database running through Apache.
The latest query to cause me grief is shown below:
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 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.autoid;
The query works fine in that I get the result I want but it is taking way to long to give me the result.
Any help at all would be REALLY appreciated.