I have one table with 33,107,887 records.
table structure: tablename
id - bigint - uniqu
text - text - fulltex index
cate_id - bigint - btree index
marchant_name - varchare - btree index
created_on - timestamp - btree index
When i run below query then its takeing 60+ seconds
SELECT * FROM tablename where marchant_name='marchant name x' order by id desc limit 20
but if i run this query then its take just 1 second
SELECT * FROM tablename where marchant_name='marchant name x' order by id asc limit 20
Note : Here marchant name x has 8mn+ records in main table.
Hear just issue with "oder by asc" and "order by desc" . Is there anyone who can help me?
Thanks