These are two simple stock quotes tables that contain a symbol and a close
amount.

 

Explain

   Select Monday.Symbol, Friday.Close, Monday.Close

   From Monday Force Index(Symbol) Inner Join Friday Force Index(Symbol) ON

     Monday.Symbol = Friday.Symbol

 

Symbol is a VarChar(20) in both tables.

There is an index on Symbol for both of these table.

 

The resultant Explain shows that 

+----------+------+-----------------+------------+---------+----------------
---+-----------+-------------+ 
| table      | type | possible_keys  | key         | key_len |        ref
| rows        | Extra         | 
+----------+------+-----------------+------------+---------+----------------
---+-----------+-------------+ 
| Monday  | All    | Symbol           | [Null]       |   [Null]  |
[Null]           | 60134    |                 | 
+----------+------+-----------------+------------+---------+----------------
---+-----------+-------------+ 
| Friday     | ref   | Symbol           | Symbol    |     21    |
Monday.Symbol  |    1        | where used | 
+----------+------+-----------------+------------+---------+----------------
---+-----------+-------------+

 

 

Why aren't both using the Symbol key?

Why isn't the Force Index working?

 

TIA

 

Dan

Reply via email to