我的表有400万数据,以下的查询,达到了28秒,其中Sending data为27秒以上,不知是啥原因哦!
districtlist已建索引,以下是查询语句:
select `phone`,`seat` from `numbers` where `districtlist`=3 order by `porder` asc limit 101182
districtlist已建索引,以下是查询语句:
select `phone`,`seat` from `numbers` where `districtlist`=3 order by `porder` asc limit 101182
explain select ...
以供分析。
select `phone`,`seat` from `numbers` where `districtlist`=3 order by `porder` asc limit 101182
2:查询计划已经使用了索引,但是需要扫描的行还是很多,
select count(distinct(districtlist))/count(*) from `numbers`;
看看这个字段的唯一性怎么样
3:show create table `numbers`;
贴出来看看。
1、2、是的,我需要按一定条件查询出所需的行数,这并不是在页面显示,而是将这些数据拿去与其它表匹对;
3、
表结构:
使用navicat查询都觉得有点慢,我使用cakephp框架就更慢了查询,参考一下我的另一个贴子:
http://bbs.csdn.net/topics/390337557
然后把结果1里的值贴出来。是想看看你的表索引。