Topic: optimizing sql query

Hi friends,
     
         While am usign database my app performance become too slow.
       I want to optimize queires.

My db structure

desc steps_details;
+----------------+----------+------+-----+---------+----------------+
| Field          | Type     | Null | Key | Default | Extra          |
+----------------+----------+------+-----+---------+----------------+
| id             | int(11)  | NO   | PRI | NULL    | auto_increment |
| user_id        | int(11)  | YES  | MUL | NULL    |                |
| steps          | text     | YES  |     | NULL    |                |
| created_at     | datetime | YES  |     | NULL    |                |
| updated_at     | datetime | YES  |     | NULL    |                |
| shortdate      | datetime | YES  | MUL | NULL    |                |
| distance       | float    | YES  |     | NULL    |                |
| calories_burnt | float    | YES  |     | NULL    |                |
+----------------+----------+------+-----+---------+----------------+
8 rows in set (0.00 sec)

mysql query is

 StepsDetails Load (10008.8ms)   SELECT user_id,count(steps) as steps FROM `steps_details` WHERE (user_id IN (47,182,183,184,185,186,187,188,189,191,193,194,195,196,199,200,203,204,206,208,209,210)) GROUP BY user_id ORDER BY count(steps) desc

its taking  10008.8ms .Whole table contains data is   13,35,928 records.
even am using indexes on user_id individually its takign long time

Re: optimizing sql query

Thanks for the information’s. Very nice and a good list, I will surely follow it. Thank again
______________
Comforter