MySQL Forums
Forum List  »  Optimizer & Parser

Re: INNER JOIN optimization
Posted by: Rick James
Date: February 28, 2010 11:20AM

EXPLAIN EXTENDED SELECT ...
SHOW WARNINGS;
Do that on both of your queries. The WARNINGS will include the query after it was rewritten by the optimizer. I expect them to be identical. (If not, show me the results, plus SHOW CREATE TABLE.)

If john% is 50% of the table, and if it cannot run "Using index" (or ...), then it will probably do a table scan instead of bothering with the index. Converting to a table scan is actually an optimization -- it avoids jumping back and forth between the index and the table.

1000 rows, and indexed on "id" -- the query should be "fast".

Given that A and B are the same size (1000 rows) and other things being equivalent, will it start with A or with B? Flip a coin; it should not matter. (I don't know, perhaps it picks the 'first' table.)

Options: ReplyQuote


Subject
Views
Written By
Posted
13230
February 22, 2010 12:52AM
3894
February 23, 2010 11:44PM
3502
February 27, 2010 01:36PM
Re: INNER JOIN optimization
3083
February 28, 2010 11:20AM


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.