Cow_boy_ 发表于 2016-4-30 14:30:36

请问数据库查询中使用group_by就达到数据库查询时间上限

我在查询数据的过程中$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;有没有大神帮忙看看解决下,谢谢!!!

Cow_boy_ 发表于 2016-4-30 14:32:36

我已经把数据库执行时间上限改成5分钟了,还是报错......
页: [1]
查看完整版本: 请问数据库查询中使用group_by就达到数据库查询时间上限