kmlau,
Friday, May 31, 2002, 1:18:26 PM, you wrote:
k> show index from gwarp;
k> mysql>
k> +-------+------------+------------+--------------+-------------+-----------+
k> -------------+----------+--------+---------+
k> -> | Table | Non_unique | Key_name | Seq_in_index | Column_name |
k> Collation | Cardinality | Sub_part | Packed | Comment |
k> ->
k> +-------+------------+------------+--------------+-------------+-----------+
k> -------------+----------+--------+---------+
k> -> | gwarp | 1 | ipindex | 1 | ip | A
k> | 165538 | NULL | NULL | |
k> -> | gwarp | 1 | macindex | 1 | mac | A
k> | 167902 | NULL | NULL | |
k> -> | gwarp | 1 | esnindex | 1 | esn | A
k> | 165538 | NULL | NULL | |
k> -> | gwarp | 1 | esnindex | 2 | timerecord | A
k> | 11753202 | NULL | NULL | |
k> -> | gwarp | 1 | sitename | 1 | sitename | A
k> | 238 | NULL | NULL | |
k> -> | gwarp | 1 | timerecord | 1 | timerecord | A
k> | 132 | NULL | NULL | |
k> ->
k> +-------+------------+------------+--------------+-------------+-----------+
k> -------------+----------+--------+---------+
k> then
k> i use explain to analyze
k> mysql> explain select * from gwarp where timerecord = '02052810000' ;
k> +-------+------+---------------+------+---------+------+----------+---------
k> ---+
k> | table | type | possible_keys | key | key_len | ref | rows | Extra
k> |
k> +-------+------+---------------+------+---------+------+----------+---------
k> ---+
k> | gwarp | ALL | timerecord | NULL | NULL | NULL | 11753202 | where
k> used |
k> +-------+------+---------------+------+---------+------+----------+---------
k> ---+
k> 1 row in set (0.00 sec)
k> Pls help timercord index is not hit !! why ? how to amend ?
MySQL doesn't use indexes if query require to access more than 30%
rows in the table. You can find some more info about how MySQL uses
indexes at:
http://www.mysql.com/doc/M/y/MySQL_indexes.html
--
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Egor Egorov
/ /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED]
/_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net
<___/ www.mysql.com
---------------------------------------------------------------------
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