logs and when viewing lists of users ... thanks to Eloy for the one on the log file.
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(" 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) ");
+ }
+
return $result;
}
`url` varchar(100) NOT NULL default '',
`info` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`),
+ KEY `timecoursemoduleaction` (time,course,module,action),
KEY `coursemoduleaction` (course,module,action),
KEY `courseuserid` (course,userid)
) TYPE=MyISAM COMMENT='Every action is logged as far as possible.';
`timeend` int(10) unsigned NOT NULL default '0',
`time` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
- UNIQUE KEY `id` (`id`)
+ UNIQUE KEY `id` (`id`),
+ KEY `courseuserid` (course,userid)
) TYPE=MyISAM;
# --------------------------------------------------------
`authority` int(10) NOT NULL default '3',
`role` varchar(40) NOT NULL default '',
PRIMARY KEY (`id`),
- UNIQUE KEY `id` (`id`)
+ UNIQUE KEY `id` (`id`),
+ KEY `courseuserid` (course,userid)
) TYPE=MyISAM COMMENT='One record per teacher per course';
#
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;
}
?>
);
CREATE INDEX prefix_log_coursemoduleaction_idx ON prefix_log (course,module,action);
-
+CREATE INDEX prefix_log_timecoursemoduleaction_idx ON prefix_log (time,course,module,action);
CREATE INDEX prefix_log_courseuserid_idx ON prefix_log (course,userid);
CREATE TABLE prefix_log_display (
time integer NOT NULL default '0'
);
+CREATE INDEX prefix_user_students_courseuserid_idx ON prefix_user_students (course,userid);
+
CREATE TABLE prefix_user_teachers (
id SERIAL PRIMARY KEY,
userid integer NOT NULL default '0',
role varchar(40) NOT NULL default ''
);
-CREATE TABLE mdl_user_coursecreators (
+CREATE INDEX prefix_user_teachers_courseuserid_idx ON prefix_user_teachers (course,userid);
+
+CREATE TABLE prefix_user_coursecreators (
id SERIAL8 PRIMARY KEY,
userid int8 NOT NULL default '0'
);
// database to determine whether upgrades should
// be performed (see lib/db/*.php)
-$version = 2003072101; // The current version is a date (YYYYMMDDXX)
+$version = 2003072800; // The current version is a date (YYYYMMDDXX)
$release = "1.1 development"; // User-friendly version number