MySQL Forums
Forum List  »  German

Re: Simpler Join: Komplette Tabelle wird gescannt
Posted by: Gregor Kempny
Date: December 15, 2012 07:30PM

Dank dir.
Es hat nur ein ORDER BY 'wt1.beliebige spalte' geholfen, ein ORDER BY wetten.id (wie von deinem Vorschlag) erzeugt weiterhin ein Full Scan.
Nun möchte ich aber im nächsten Schritt eben nach einer Spalte in der Tabelle wetten sortieren und nicht nach einer Spalte in wt1 (wetten_wetten_teams).
Das funktioniert dann z.B. auch wieder nicht:
EXPLAIN SELECT wetten.id
FROM wetten_wetten AS wetten
INNER JOIN wetten_wetten_teams AS wt1
ON wt1.wette = wetten.id
ORDER BY wetten.zeit_wettende, wt1.wette
LIMIT 5
Erzeugt wieder ein Fullscan. :( Kombinationen mit WHERE ebenfalls.
Wieso ist so eine kleine Abfrage so umperformant und wie kann ich das umformulieren?

Options: ReplyQuote




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.