Hi there, I hope someone will can help me... First, sorry for bad english :)
i'm french
First all I have those index in my table
+-------+-------------------+-----------------+--------------------+--------
--------------+-------------+----------------+--------------+------------+--
------------+
| Table | Non_unique | Key_name  | Seq_in_index | Column_name | Collation |
Cardinality | Sub_part | Packed | Comment |
+-------+-------------------+-----------------+--------------------+--------
--------------+-------------+----------------+--------------+------------+--
------------+
| Stats |          0       | PRIMARY   |            1        | ID
| A          |     4568748 |     NULL  | NULL    |               |
| Stats |          1       | Port_ID       |            1        | Port_ID
| A          |           1      |     NULL  | NULL    |               |
| Stats |          1       | Timestamp  |            1        | Timestamp
| A          |       49126   |     NULL  | NULL    |               |
+-------+-------------------+-----------------+--------------------+--------
--------------+-------------+----------------+--------------+------------+--
------------+

You have to know I have 4 500 000 in my db

Okay I have this query:
select Timestamp from Stats use index (Timestamp) where Timestamp >=
'2002-01-01' and Timestamp < '2002-02-01' order by Timestamp limit 1;
this one is jsut doing fine.. it take 0.00 sec to do it...

but
select Timestamp from Stats use index (Timestamp) where Timestamp >=
'2002-01-01' and Timestamp < '2002-02-01' order by Timestamp desc limit 1;
this one take sometime 10 sec to do.... I understand is the desc the prob..
because my index is in asc (collation=A)
my question is... is there a way for maiking a index in desc? or maybe
something else?

Jean-Francois Dionne
Yard


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