Select * from table1 where tid=2 or tid=3
这个就算tid使用了索引也会失效,那怎么办?在查询的时候肯定会有很多查询是需要使用 or 的啊
------解决方案--------------------
Select * from table1 where tid in(2,3)
试试
------解决方案--------------------
不懂索引的飘过,好吧,我承认我今天只是为了回帖而来的
------解决方案--------------------
------解决方案--------------------
------解决方案--------------------
- SQL code
--试试这样Select * from table1 where tid>1 and tid<4
------解决方案--------------------
如果tid是聚集索引,你这样写法应该可以用到的。
------解决方案--------------------
------解决方案--------------------
没有索引,也想使用索引,或者想快速,未必要求太高了吧?
------解决方案--------------------