-
Improvement
-
Resolution: Fixed
-
Major
-
2.8
-
MOODLE_28_STABLE
-
MOODLE_29_STABLE
-
MDL-48108-master -
-
Team Beards Sprint 3
-
Medium
While looking through the slow query log, found this nice slow query:
# Query_time: 14.251499 Lock_time: 0.000126 Rows_sent: 6 Rows_examined: 124720
|
SELECT otheruser.id,otheruser.picture,otheruser.firstname,otheruser.lastname,otheruser.firstnamephonetic,otheruser.lastnamephonetic,otheruser.middlename,otheruser.alternatename,otheruser.imagealt,otheruser.email,otheruser.lastaccess,
|
message.id as mid, message.notification, message.smallmessage, message.fullmessage,
|
message.fullmessagehtml, message.fullmessageformat, message.timecreated,
|
contact.id as contactlistid, contact.blocked
|
|
FROM message message
|
JOIN user otheruser ON otheruser.id = CASE
|
WHEN message.useridto = '1031471' THEN message.useridfrom
|
ELSE message.useridto END
|
LEFT JOIN message_contacts contact ON contact.userid = '1031471' AND contact.contactid = otheruser.id
|
|
WHERE otheruser.deleted = 0
|
AND (message.useridto = '1031471' OR message.useridfrom = '1031471')
|
AND message.notification = 0
|
AND NOT EXISTS (
|
SELECT 1
|
FROM message othermessage
|
WHERE ((othermessage.useridto = '1031471' AND othermessage.useridfrom = otheruser.id) OR
|
(othermessage.useridfrom = '1031471' AND othermessage.useridto = otheruser.id))
|
AND (othermessage.timecreated > message.timecreated OR (
|
othermessage.timecreated = message.timecreated AND othermessage.id > message.id))
|
)
|
|
ORDER BY message.timecreated DESC LIMIT 0, 100;
|
- caused a regression
-
MDL-49960 Error when attempting to view messaging recent conversations
-
- Closed
-
- has a non-specific relationship to
-
MDL-49381 Remove partial index from messaging tables
-
- Closed
-
- has been marked as being related by
-
MDL-51954 Messages query still slow
-
- Closed
-
-
MDL-52928 Repeating Error in Messaging / Recent Conversations area
-
- Closed
-
-
MDL-29801 Messaging: unable to delete a message
-
- Closed
-
- is duplicated by
-
MDL-51865 Improve message_get_recent_conversations query performance
-
- Closed
-