Hi All,
I've got a problem with an index..i already create an index for a column in 1 table.
+--------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment |
+--------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
| mobal | 1 | mobal_idx | 1 | DateSend | A | NULL | NULL | NULL | | BTREE | |
+--------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
this is the structure of mobal table:
+--------------+--------------------------+------+-----+---------------------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------+--------------------------+------+-----+---------------------+-------+
| RecordID | int(10) unsigned | | | 0 | |
| DateInsert | datetime | | | 0000-00-00 00:00:00 | |
| DateSend | datetime | | MUL | 0000-00-00 00:00:00 | |
| MobileNumber | varchar(11) | | | | |
| MONumber | varchar(20) | | | | |
| Message | varchar(225) | | | | |
| Status | enum('Status','Failure') | YES | | NULL | |
+--------------+--------------------------+------+-----+---------------------+-------+
the problem is...i dunno exactly how to query the index table. i tried browse in the internet on how to do that but still didnt get the solution...mayb becoz i'm not understand enough about indexing table.
this is my query : select count(*) from mobal where DateSend='2005-02-10 00:00:00';
How to use the index in the above select statement?
for ur info, mobal table consists of 1 million data on that date ('2005-02-01 00:00:00). when i query this syntax, the process of retrieving the result very much slow...
Actually my application was designed to monitor SMS traffic so, there was a possibility that in 1 day, the traffic flows getting heavy, maybe minimum or more than 1 million. So, i had to increase the performance of my web by reducing the time taken to retrieve all the data for that particular month/day..Pls anyone help me in solving this problem..the due date of this project is just around the corner..
thanks in advance...