Yes, this is correct. But the thing is that I don't want to find out how 
a certain query is processed but instead how the processing is done when 
the query type is determined by the join optimizer. When the optimizer has 
decided to do a full table scan, does it do it as a nested loop join, a 
block nested loop join or with what algorithm? And if the query includes 
an ORDER BY, is the query processed as sort merge join, or as nested loop 
join which is then sorted. Or a hash join?

So my question is not what join type (const, range, eq-ref, index 
scan, table scan) the optimizer chooses for a particular query, but how 
these join types are implemented and in which order they execute the 
operations (joining, sorting).


On Wed, 11 Sep 2002 [EMAIL PROTECTED] wrote:

> 
> 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

Reply via email to