Skip to content
Browse files

MDL-39725 database: Apply database statistics update to daily stats

  • Loading branch information...
1 parent 9cd60b2 commit 5470f3859f829d4b9dc014ea30d4c6c91edbcb35 @mr-russ mr-russ committed with Sam Hemelryk Jun 30, 2013
Showing with 9 additions and 0 deletions.
  1. +9 −0 lib/statslib.php
View
9 lib/statslib.php
@@ -259,6 +259,7 @@ function stats_cron_daily($maxdays=1) {
$failed = true;
break;
}
+ $DB->update_temp_table_stats();
stats_progress('1');
@@ -385,6 +386,10 @@ function stats_cron_daily($maxdays=1) {
$failed = true;
break;
}
+ // The steps up until this point, all add to {temp_stats_daily} and don't use new tables.
+ // There is no point updating statistics as they won't be used until the DELETE below.
+ $DB->update_temp_table_stats();
+
stats_progress('7');
// Default frontpage role enrolments are all site users (not deleted)
@@ -581,6 +586,7 @@ function stats_cron_daily($maxdays=1) {
$failed = true;
break;
}
+ $DB->update_temp_table_stats();
stats_progress('15');
// How many view actions for guests or not-logged-in on frontpage
@@ -1736,6 +1742,9 @@ function stats_temp_table_fill($timestart, $timeend) {
$DB->execute($sql);
+ // We have just loaded all the temp tables, collect statistics for that.
+ $DB->update_temp_table_stats();
+
return true;
}

0 comments on commit 5470f38

Please sign in to comment.
Something went wrong with that request. Please try again.