MySQL Forums
Forum List  »  Performance

Re: Long query locking up MySQL Server
Posted by: Rick James
Date: December 03, 2010 09:21PM

Doh! You had indexes, and I was blind to them.

Yes, INDEX(a) is almost always not worth having if you also have INDEX(a,b).

All three flavors of the SELECT are probably identical in the EXPLAIN.
FROM a, b WHERE ...
FROM a JOIN b ON ...
FROM b JOIN a ON ...

These are likely to be the useful indexes:
flights: INDEX(kod_panstwa_ISO, kod_regionu) -- to 'eliminate' the GROUP BY
kody_regionow: INDEX(kod) -- to JOIN to the other table
(Or any indexes starting with those field(s).)

Since you have those, and since you are asking to read all of both tables, there may not be any further optimizations.

Options: ReplyQuote


Subject
Views
Written By
Posted
4035
December 01, 2010 05:23AM
1083
December 02, 2010 12:27AM
904
December 03, 2010 08:46AM
Re: Long query locking up MySQL Server
801
December 03, 2010 09:21PM
2076
December 04, 2010 11:44AM


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.