If you run explain table_name in your mysql client and paste the output together with an example of data maybe we can give you a hand. And also paste the query.
cereal
Veteran Poster
1,195 posts since Aug 2007
Reputation Points: 358
Solved Threads: 231
Skill Endorsements: 22
put indexes on the columns that you use in the where clause
steelshark
Junior Poster in Training
59 posts since Sep 2010
Reputation Points: 10
Solved Threads: 6
Skill Endorsements: 0
In addition to the suggestions:
Using LIMIT clause may speed things up if you're after a specific number of records. Avoiding the '*' for return fields and naming the exact fields you want to return should also speed things up.
Using JOINS instead of subqueries where possible.
diafol
Keep Smiling
10,838 posts since Oct 2006
Reputation Points: 1,675
Solved Threads: 1,534
Skill Endorsements: 61
2 Lakhs
Are we talking 200,000 (or 2,00,000 in Asian num)? So you're saying that you have a long-ish table? Please post your query. We can't help properly if you don't provide this info.
diafol
Keep Smiling
10,838 posts since Oct 2006
Reputation Points: 1,675
Solved Threads: 1,534
Skill Endorsements: 61
Question Answered as of 11 Months Ago by
diafol,
cereal,
steelshark
and 1 other