Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there anything quicker than a LEFT JOIN?!!

Status
Not open for further replies.

Spijker

Programmer
Jan 9, 2001
10
NZ
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top