Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Won't Fix
-
Affects Version/s: 1.9.3
-
Fix Version/s: None
-
Component/s: Database activity module
-
Labels:None
-
Environment:Moodle1.9.3 (20081015). Server: Php5.2.6/MySql4.1.20
-
Database:MySQL
-
Affected Branches:MOODLE_19_STABLE
Description
I've updated to Moodle1.9.3 (20081015). Server: Php5.2.6/MySql4.1.20
It looks OK for one user. But, when several users online, it will be very slow.
By checking the server, there is a database query being performed which is taking a long time:
eg.
- Query_time: 44 Lock_time: 6 Rows_sent: 1 Rows_examined: 20508510
SELECT DISTINCT r.id, r.approved, r.timecreated, r.timemodified,
r.userid, u.firstname, u.lastname FROM mdl_data_content
c,mdl_data_records r,mdl_data_content cs, mdl_user u WHERE c.recordid =
r.id
AND r.dataid = 8
AND r.userid = u.id
AND cs.recordid = r.id ORDER BY
r.timecreated DESC, r.id ASC LIMIT 107,1;
this query takes 44 seconds to complete, and examins 20 million rows.
Problem is the reference to mdl_data_content ,seems to be in the FROM line twice:
mdl_data_content c
mdl_data_content cs
seems the c refence is not being used.
removing this and changing c.recordid= r.id to cs.recordid = r.id
speeds up the query immensely ( to 0.01 seconds)
this needs to be fixed as its starting to have an impact on the database
server.
File location: moodle/mod/data/view.php
Attachments
Issue Links
| This issue is duplicated by: | ||||
| MDL-19584 | Query multiple, overflowing database platform |
|
|
|
Updated on line 441 and 445