From: moodler Date: Mon, 28 Jul 2003 03:28:43 +0000 (+0000) Subject: Added some flushes in case the indexes take too long ... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=1dbb6e5031b0be48c177909b79a0da82f05106cf;p=moodle.git Added some flushes in case the indexes take too long ... --- diff --git a/lib/db/mysql.php b/lib/db/mysql.php index 7ad20d9af2..33ea8caaf5 100644 --- a/lib/db/mysql.php +++ b/lib/db/mysql.php @@ -407,6 +407,7 @@ function main_upgrade($oldversion=0) { 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"); + flush(); execute_sql(" ALTER TABLE `{$CFG->prefix}log` ADD INDEX timecoursemoduleaction (time,course,module,action) "); execute_sql(" ALTER TABLE `{$CFG->prefix}user_students` ADD INDEX courseuserid (course,userid) "); execute_sql(" ALTER TABLE `{$CFG->prefix}user_teachers` ADD INDEX courseuserid (course,userid) "); diff --git a/lib/db/postgres7.php b/lib/db/postgres7.php index 9d7afae016..653423fef6 100644 --- a/lib/db/postgres7.php +++ b/lib/db/postgres7.php @@ -178,6 +178,7 @@ function main_upgrade($oldversion=0) { 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"); + flush(); 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) ");