用户
 找回密码
 入住 CI 中国社区
搜索
查看: 1018|回复: 1
收起左侧

[版本 3.x] 请问数据库查询中使用group_by就达到数据库查询时间上限

[复制链接]
发表于 2016-4-30 14:30:36 | 显示全部楼层 |阅读模式
我在查询数据的过程中$this->db->select('count(client_city) ,client_city')->from('taskshare_record')->where(array('aid'=>$aid))->limit(10)->order_by('count(client_city)','desc')->get()->result_array();这样不写group_by(" xxx  ")就可以执行,如果写成  $this->db->select('count(client_city) ,client_city')->from('taskshare_record')->where(array('aid'=>$aid))->group_by("client_city")->limit(10)->order_by('count(client_city)','desc')->get()->result_array();就会执行变得特别慢,然后报错:Fatal error: Maximum execution time of 300 seconds exceeded in F:\wamp\www\sql\system\database\drivers\mysqli\mysqli_driver.php on line 305;有没有大神帮忙看看解决下,谢谢!!!
 楼主| 发表于 2016-4-30 14:32:36 | 显示全部楼层
我已经把数据库执行时间上限改成5分钟了,还是报错......

本版积分规则