Hi, all:
    I create a table as following:
    CREATE TABLE appsvr_trarte (
  rte_id bigint(38) NOT NULL auto_increment,
  strConfName varchar(70) NOT NULL default '',
  lFromTime int(16) unsigned NOT NULL default '0',
  lToTime int(16) unsigned NOT NULL default '0',
  iSvrType tinyint(2) unsigned NOT NULL default '0',
  sSrvIP int(10) unsigned NOT NULL default '0',
  sClitIP int(10) unsigned NOT NULL default '0',
  iSpeed int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (rte_id),
  KEY idx_trarte (lFromTime,sSrvIP,sClitIP)
) TYPE=MyISAM;

    However, after INSERT into some data( lFromTime,sSrvIP,sClitIP are not
unique ), I am astonished by the following:
mysql> explain SELECT lFromTime ,iSvrType,iSpeed FROM appsvr_trarte where
lFromTime >= 1009818000  and lFromTime  < 1017594000;
+----------------+------+---------------+------+---------+------+--------+--
----------+
| table          | type | possible_keys | key  | key_len | ref  | rows   |
Extra      |
+----------------+------+---------------+------+---------+------+--------+--
----------+
| appsvr_trarte | ALL  | idx_trarte    | NULL |    NULL | NULL | 168359 |
where used |
+----------------+------+---------------+------+---------+------+--------+--
----------+
1 row in set (0.00 sec)

    I have used /usr/local/mysql/bin/myisamchk -a appsvr_trarte , but no
effect.
    I wonder why MySql didn't use index while querying? And how to resolve
it?
    Thank you for any help!

B.R.
Buding



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