MySQL Forums
Forum List  »  InnoDB

Query optimizing
Posted by: Marcel Kamst
Date: February 08, 2009 04:40AM

Hi,

I am an enthusiastic sql newbie. I have written following statement with lots of inner joins. Although the query works, I am sure that there is a better way. I am especially worried about the performance as soon as the tables get bigger.

SELECT laender.landname,staedte.stadtname,marker.name FROM laender
INNER JOIN marker ON laender.idl = marker.land
INNER JOIN staedte ON marker.stadt = staedte.ids
INNER JOIN markertyp ON marker.markertyp_id = markertyp.id
INNER JOIN kunden ON marker.kunden_id = kunden.idk
INNER JOIN stoerung ON marker.id = stoerung.marker_id
WHERE markertyp.id = 1
AND markertyp.hersteller_id = 1
AND kunden.idk = 1
AND stoerung.enddatum = 0
GROUP BY laender.idl,staedte.ids,marker.id
ORDER BY laender.landname,staedte.stadtname,marker.name

Any comments?

Thanks in advance, Marcel

Options: ReplyQuote


Subject
Views
Written By
Posted
Query optimizing
2734
February 08, 2009 04:40AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.