I have a problem with the mysql query that uses both order by and limit.Following is the sql query i'm using,
select * from temp where venue <> '' and cat1 = 'sports' and id < 74528 order by id desc limit 10;
in this temp table 'id' is primary key, and i created index on venue, cat1. This query is examining 78000 records out of 90000. If i can remove order by or limit then it's examining 2000 records only. I need both order by id, limit in this query but number records examining should reduce.
Can you please tell me the reason why it's performing like that?