Hi all,


>I gave not enough info about indexes. Use SHOW INDEX FROM table_name

sorry, now 2nd try with more info.



>> This bug was reported to fixed in 3.23.38.
>> But the mysql versions 3.23.49 and in 4.0.2
>> both look like as the bug is in them again.
>>
>> Example:
>> The following query should use the index on
>> dog.dog_timestamp_cr but uses filesort instead.
>>
>> mysql> EXPLAIN SELECT dog.dog_id, dog.dog_name, sire.dog_name as
>> dog_sirename   FROM dogs dog   LEFT JOIN dogs as sire ON (dog.dog_sireid
=
>> sire.dog_id)   ORDER BY dog.dog_timestamp_cr  LIMIT 100;
>>
>> | table | type   | possible_keys | key     | key_len | ref            |
rows   | Extra          |
>> | dog   | ALL    | NULL          | NULL    |    NULL | NULL           |
416827 | Using filesort |
>> | sire  | eq_ref | PRIMARY       | PRIMARY |       3 | dog.dog_sireid |
1 |                |
>>

mysql> show index from dogs;
|Non_unique | Key_name  | Seq_in_index | Column_name | Collation |
Cardinality | Sub_part | Packed | Null | Index_type |
| 0 | PRIMARY          | 1 | dog_id           | A  |  416827 | NULL | NULL
|      | BTREE |
| 1 | ind_dog_sireid   | 1 | dog_sireid       | A  |    NULL | NULL | NULL
|      | BTREE |
| 1 | ind_dog_damid    | 1 | dog_damid        | A  |    NULL | NULL | NULL
|      | BTREE |
| 1 | dog_timestamp    | 1 | dog_timestamp    | A  |    NULL | NULL | NULL
|      | BTREE |
| 1 | dog_timestamp_cr | 1 | dog_timestamp_cr | A  |    NULL | NULL | NULL
|      | BTREE |


any ideas?


best regards

Gunnar

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