MDL-15719 "overview report slow for large data sets - count sql operation for table paging repeated twice whether or not it is necessary"

This commit is contained in:
jamiesensei
2008-07-20 12:21:59 +00:00
parent 66eb3b5930
commit 0fa4107dfc
+3 -1
View File
@@ -1187,8 +1187,10 @@ class table_sql extends flexible_table{
if ($this->get_sql_where()) {
$this->countsql .= ' AND '.$this->get_sql_where();
$this->sql->where .= ' AND '.$this->get_sql_where();
$total = $DB->count_records_sql($this->countsql, $this->countparams);
} else {
$total = $totalinitials;
}
$total = $DB->count_records_sql($this->countsql, $this->countparams);
$this->pagesize($pagesize, $total);