我有一张表有33,107,887条记录。
表结构:tablename
id - bigint - uniqu
text - text - fulltex index
cate_id - bigint - btree index
marchant_name - varchare - btree index
created_on - timestamp - btree index
当我在查询下方运行时,它需要花费60多秒
SELECT * FROM tablename where marchant_name='marchant name x' order by id desc limit 20
但如果我运行此查询,则只需1秒
SELECT * FROM tablename where marchant_name='marchant name x' order by id asc limit 20
注意:这里的名字x在主表中有8mn +记录。
听到“oc by asc”和“by desc”的问题。有没有人可以帮助我?
由于