Improved indexing for improved performance on the course page, when viewing

logs and when viewing lists of users ... thanks to Eloy for the one on the log file.
This commit is contained in:
moodler
2003-07-28 02:51:56 +00:00
parent 8b0ef9b0cb
commit a8fa25d18d
5 changed files with 26 additions and 5 deletions
+7
View File
@@ -176,6 +176,13 @@ function main_upgrade($oldversion=0) {
table_column("course_sections", "sequence", "sequence", "text", "", "", "", "", "");
}
if ($oldversion < 2003072800) {
print_simple_box("The following database index improves performance, but can be quite large - if you are upgrading and you have problems with a limited quota you may want to delete this index later from the '{$CFG->prefix}log' table in your database", "center", "50%", "$THEME->cellheading", "20", "noticebox");
execute_sql(" CREATE INDEX {$CFG->prefix}log_timecoursemoduleaction_idx ON {$CFG->prefix}log (time,course,module,action) ");
execute_sql(" CREATE INDEX {$CFG->prefix}user_students_courseuserid_idx ON {$CFG->prefix}user_students (course,userid) ");
execute_sql(" CREATE INDEX {$CFG->prefix}user_teachers_courseuserid_idx ON {$CFG->prefix}user_teachers (course,userid) ");
}
return $result;
}
?>