Hi

I have been working on this problem for some time now and none of the 
local experts seem to be able to come up with a concise answer as to why a 
LEFT JOIN should take so incredibly long to run.

This is the query in question:

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;


I have tried removing the DISTINCT but that made no noticeable difference. 
Any help would be greatly appreciated.

-------------------------------------------------------------
Rob Spijkerman           27 Nazareth Avenue
Database Developer               PO Box 8011
Allied Telesyn Research  Christchurch
phone +64 3 339 3000     New Zealand
fax   +64 3 339 3001     email: [EMAIL PROTECTED]
                         web: http://www.alliedtelesyn.co.nz/
-------------------------------------------------------------

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to