That is why you need to use the EXPLAIN command. As I understand it, MySQL has a number of different ways of doing a JOIN, and it attempts to optimise those dynamically by inspecting not only which indexes it has available but the sizes of the tables involved (e.g. to try to use the brute-force scan on the smallest table). The way in which any given JOIN will be processed will therefore change as the table grows/shrinks, and EXPLAIN is the best way to find out what it is doing.
At least, that is my understanding. If incorrect. I would appreciate correction by those more knowledgeable. > I am interested in the internal join algorithms, not the join types that > can be found in the manual. My question is how the join types in the > manual are processed internally? Or, what are the different join > algorithms supported by MySQL? > > It depends on your database & query structure and especially what > > indexes are available. If you just put "explain" in front of your query > > you will be able to see how mysql will execute your query. > > > > On Tuesday, September 10, 2002, at 09:45 AM, Toni Strandell wrote: > > > > > >> How does MySQL process a join between tables? Does it always use > >> nested-loop join, or does it use sort-merge join if the table is sorted > >> before joining it? Is the join algorithm merge if the tables are > >already > >> sorted on the join attributes (through an index)? Alec Cawley --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php