单表 5 千万了,数据量也继续上涨,想把表拆分成 10 个;
article_comments_0
article_comments_100
我现在想统计一下总数都得这样查询:
function get_count_comments() {
$aid = 0;
for($i = 0; $i < 100; $i++) {
$num += $this->db->result("SELECT COUNT(*) FROM article_comments_'.(string)$i);
}
return $num;
}
for 100 次呀,列表还没查呢,还有没更好的方法?
列表分页有什么好的解决方案,期待 V2 高手解答一下;
article_comments_0
article_comments_100
我现在想统计一下总数都得这样查询:
function get_count_comments() {
$aid = 0;
for($i = 0; $i < 100; $i++) {
$num += $this->db->result("SELECT COUNT(*) FROM article_comments_'.(string)$i);
}
return $num;
}
for 100 次呀,列表还没查呢,还有没更好的方法?
列表分页有什么好的解决方案,期待 V2 高手解答一下;