hey,

>Well, how many records are in the table?  How many would be returned by the
>query you present?

My prefered (gw)  table have 8313193 records for trail (on production should
have 70,000,000 records approximately ) . And no. of records are returned
have 71430 records by the query.

>Is the SQL you show the FULL sql?

Yes, my full sql statement is that select * from gw where timerecord =
'0109020000' . (Remarks,  I want to find out data within a period for
analyzing.)

>What is the output of the EXPLAIN SELECT....

Shown as below :

table  type     possible_keys  key   key_len ref   rows                 Extra
 gw     ALL   timerecord                           8313193      where used

>What about "SHOW INDEX FROM TABLE gw".
mysql> SHOW INDEX FROM  gw;
+-------+------------------+----------------+-------------------+-----------
-----------+-------------+---------------+-------------+----------+---------
------+
| Table | Non_unique | Key_name  | Seq_in_index | Column_name | Collation |
Cardinality | Sub_part | Packed | Comment |
+-------+------------------+----------------+-------------------+-----------
-----------+-------------+---------------+-------------+----------+---------
------+
| gw    |          1           | timerecord |            1             |
timerecord          | A               |         119      |     NULL   | NULL
|                     |
| gw    |          1              | esnindex    |            1             |
esn                       | A               |      113879  |     NULL   |
NULL   |                     |
| gw    |          1              | esnindex    |            2             |
timerecord          | A               |     8313193 |     NULL   | NULL   |
|
+-------+------------------+---------------+--------------------+-----------
-----------+-------------+---------------+-------------+----------+---------
------+
3 rows in set (0.00 sec)



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Bill Adams
Sent: Thursday, October 25, 2001 6:09 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: FW: pls help for index problem


Well, how many records are in the table?  How many would be returned by the
query you present?

Is the SQL you show the FULL sql?

What is the output of the EXPLAIN SELECT....

What about "SHOW INDEX FROM TABLE gw".

b.


kmlau wrote:

> -----Original Message-----
> From: kmlau [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, October 24, 2001 9:42 AM
> To: 'Bill Adams'
> Subject: RE: pls help for index problem
>
> Thanks yr promptly reply !!
>
>   It seems no any change(improvement) by running explain again after erase
> quotes.   I also ran the command 'myisamchk -a gw.MYI'  before sending
this
> consulting mail !!
> Would U give me more advice ?
>
> regards,
> kmlau
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Bill Adams
> Sent: Tuesday, October 23, 2001 11:11 PM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: pls help for index problem
>
> kmlau wrote:
>
> >  I encountered a problem about indexing.  I want to add index on
> timerecord
> > field in table gw (shown as below) to speed up query relating with time.
> > However, I use explain command (explain select * from gw where
timerecord
> =
> > '0109020000') to analyze the performace. As a result, it seems the query
> do
> > not use this index. Would U tell me why and how to correct this !!
>
> U do not need to specify the timestamp as a string, e.g. remove the
> quotes: timerecord=109020000.  But more importantly run 'myisamchk -a' on
> the index
> (.MYI) file.  Doing both of these will help.
>
> b.
>
> ---------------------------------------------------------------------
> 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
>
> ---------------------------------------------------------------------
> 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

--
Bill Adams
TriQuint Semiconductor



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