Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Critical
-
Resolution: Unresolved
-
Affects Version/s: 1.9.5
-
Fix Version/s: None
-
Component/s: Database activity module
-
Labels:None
-
Environment:PHP Version 5.1.6
Mysql 5.0.45
Linux Red Hat 4.1.2-44
-
Database:MySQL
-
Difficulty:Moderate
-
Affected Branches:MOODLE_19_STABLE
Description
We have a problem with the following Moodle module "Database":
"/mod/data/view.php?d=122&mode=asearch"
In certain cases, Moodle tries to execute a query on a course and the Mysql database gets collapsed.
This is the mumber of records from the tables of our database:
mdl_data_content ? 7300 records
mdl_data_records ? 1200 records
mdl_user ? 7200 records
This is one of the Mysql queries, which causes the problem:
This query generates the following "Cartesian Product" which causes the database to hang:
SELECT COUNT(DISTINCT c.recordid)
FROM mdl_data_content c,
mdl_data_records r,
mdl_data_content cs,
mdl_user u ,
mdl_data_content c375 ,
mdl_data_content c376 ,
mdl_data_content c377 ,
mdl_data_content c378
WHERE c.recordid = r.id
AND r.dataid = 105
AND r.userid = u.id
AND cs.recordid = r.id
AND c375.recordid = r.id
AND c376.recordid = r.id
AND c377.recordid = r.id
AND c378.recordid = r.id;
We expect your help for our problem, thank you very much in advance.
Greetings.
Attachments
Issue Links
| This issue duplicates: | ||||
| MDL-17051 | Moodle1.9.3 getting slow |
|
|
|
Hi,
I'm the programmer at the University of Bath working on Moodle. We have experienced the same problem. I wanted to know if anyone is currently looking at this? If not, or if this is in limbo, then I'll resolve this, hopefully I can allocate time next week. This is a serious problem as these queries have actually managed to bring our entire Moodle system down when a student runs a more complicated search in the Database Module.
So before I get stuck in and potentially duplicate effort, has anyone else made a start on this?
Thanks,
Taliesin Nuin.