Moodle Calendar - Problem with large table

Moodle Calendar - Problem with large table

by Tony Braithwaite -
Number of replies: 0

We have been experimenting with using the Moodle Calendar for individual student timetables.   I have set up an import to the mdl_event table which imports some 670,000 records of the format in the attached text file.

All seemed to be OK until users started making changes to other parts of the site, such as hiding courses etc and this seems to create the following query on the database (we are using MS SQL 2008):

SELECT * FROM mdl_event WHERE instance ='1508'AND modulename =N'url'

This is causing a block on the DB server as it is taking about 2 minutes to read the entire mdl_event table.  The site was eventually completetly stalling.

What we don't quite follow is why the mdl_event table is being queried when it's really the calendar table and not a moodle event table, it's not mentioned in http://docs.moodle.org/dev/Events_API.  

We are not a very big institution and I'm sure others must have many many more records stored in the mdl_event table.

Some guidance would be very much appreciated.

Average of ratings: -