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
+6 -2
View File
@@ -76,7 +76,7 @@ CREATE TABLE prefix_log (
);
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 (
@@ -147,6 +147,8 @@ CREATE TABLE prefix_user_students (
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',
@@ -155,7 +157,9 @@ CREATE TABLE prefix_user_teachers (
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'
);