I recently asked for some help with join order and it's now fixed, kinda :)

On a web server running mySQL version 3.22.32 on a Linux box (cobalt RAQ) I get the 
following output for this query:

EXPLAIN SELECT * FROM (LOG_LOG LEFT JOIN SAT_CMD ON LOG_LOG.LOG_ID=SAT_CMD.LOGID) LEFT 
JOIN SAT_GEN ON LOG_LOG.LOG_ID=SAT_GEN.LOGID; 

      table type possible_keys key key_len ref rows Extra 
      LOG_LOG ALL NULL NULL NULL NULL 41   
      SAT_CMD ALL LOGID NULL NULL NULL 7   
      SAT_GEN eq_ref LOGID LOGID 8 LOG_LOG.LOG_ID 1   


As you can see it's not an optimal query.  Nothing I did could fix it.

So I dumped the tables and put them on my local machine running mySQL version 
3.23.28-gamma on Win98.  This is the output I get now for the same query:

+---------+--------+---------------+-------+---------+----------------+------+-------+
| table   | type   | possible_keys | key   | key_len | ref            | rows | Extra |
+---------+--------+---------------+-------+---------+----------------+------+-------+
| log_log | ALL    | NULL          | NULL  |    NULL | NULL           |   41 |     |
| sat_cmd | eq_ref | LOGID         | LOGID |       8 | log_log.log_id |    1 |     |
| sat_gen | eq_ref | LOGID         | LOGID |       8 | log_log.log_id |    1 |     |
+---------+--------+---------------+-------+---------+----------------+------+-------+
3 rows in set (0.55 sec)

All fields remained the same except for case and all indexes are the same.

Is it the different versions causing this or different platforms?

Thanks and thanks for the previous help in getting this query working in the first 
place,

Chuck Murison



Reply via email to