日期:2014-05-17  浏览次数:21027 次

怎么提高count ()速度????
customer有两千万条数据 怎么提高count ()速度????
select count(createTime) from customer where createman='wgliu';
其中createTime和createman 都是索引列
------解决方案--------------------
createman  createTime组合index
------解决方案--------------------
如果表有适合建立位图索引的列(Customer表的话应该有性别列),那么建立位图索引,然后再用count(位图索引的列),那么效率非常非常快!不超过1秒!
------解决方案--------------------
可以像楼上说的,尝试下位图索引!