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.
Subject
Views
Written By
Posted
4035
December 01, 2010 05:23AM
996
December 01, 2010 02:54PM
1083
December 02, 2010 12:27AM
982
December 03, 2010 05:54AM
968
December 03, 2010 08:05AM
904
December 03, 2010 08:46AM
903
December 03, 2010 11:59AM
954
December 03, 2010 01:52PM
970
December 03, 2010 02:23PM
854
December 03, 2010 02:32PM
926
December 03, 2010 03:20PM
Re: Long query locking up MySQL Server
801
December 03, 2010 09:21PM
942
December 04, 2010 01:52AM
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.