select statu_id from tcharge where phone=? and cash=? and time>? order by id desc
id已经是主键了.这个表数据很大,有几百万条数据,并且插入也不是很少.但是比查询少(一半吧).
那么我优化这个库适合加索引吗?如果加怎么加?加组合还是单体?加几个?
...全文
2066打赏收藏
此sql如何添加索引 效率最高?
select statu_id from tcharge where phone=? and cash=? and time>? order by id desc id已经是主键了.这个表数据很大,有几百万条数据,并且插入也不是很少.但是比查询少(一半吧). 那么我优化这个库适合加索引吗?如果加怎么加?加组合还是单体?加几个?