Issue Details (XML | Word | Printable)

Key: MDL-17051
Type: Bug Bug
Status: Open Open
Priority: Critical Critical
Assignee: Eloy Lafuente (stronk7)
Reporter: Wenxin Lu
Votes: 8
Watchers: 14
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Moodle1.9.3 getting slow

Created: 29/Oct/08 07:47 AM   Updated: 02/Jul/09 11:27 PM
Return to search
Component/s: Database activity module
Affects Version/s: 1.9.3
Fix Version/s: None

File Attachments: 1. File view.php (28 kB)

Image Attachments:

1. view_php.jpg
(50 kB)
Environment: Moodle1.9.3 (20081015). Server: Php5.2.6/MySql4.1.20
Issue Links:
Blockers
 

Database: MySQL
Participants: Eloy Lafuente (stronk7), Generazion Consulting S.L., Petr Skoda and Wenxin Lu
Security Level: None
Affected Branches: MOODLE_19_STABLE


 Description  « Hide
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


 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
No commits have yet been performed on this issue.