海豚php超过百万数据分页列表卡死

海豚php超过百万数据分页列表卡死,原因是会去链表查询count(),这个语句很耗时,导致卡死 官方有好的解决方案吗?
 
thinkphp/library/think/db/Query.php:1339
问题定位:=9pt$total =9pt= =9pt$this=9pt->=9ptcount=9pt();
<?php
public function count($field = '*'){
if (isset($this->options['group'])) {
// 支持GROUP
$options = $this->getOptions();
$subSql = $this->options($options)->field('count(' . $field . ')')->bind($this->bind)->buildSql();
return $this->table([$subSql => '_group_count_'])->value('COUNT(*) AS tp_count', 0, true);
}

return $this->value('COUNT(' . $field . ') AS tp_count', 0, true);
}
?>
这里如果列表有链表查询且当数据量超过百万条后查询瞬间卡死!!
 
 
 
 
已邀请:

mrcai - 海豚PHP资深开发

赞同来自:

这个和海豚框架没有关系把 检查下数据表是否有合适的索引

要回复问题请先登录注册