我现在有一个表,5万条记录,因为有照片,表有500m左右,怎么能使count的效率提高。
select count(*) from table1;
select count(*) from table1 where a <> '1'; --a是table1的字段,但没有索引。
请问怎么优化以上两种语句,提高效率。
先谢过。
select count(*) from table1;
select count(*) from table1 where a <> '1'; --a是table1的字段,但没有索引。
请问怎么优化以上两种语句,提高效率。
先谢过。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货