-
Improvement
-
Resolution: Deferred
-
Minor
-
None
-
3.9.2
-
None
-
MOODLE_39_STABLE
Methods \message_output_popup::cleanup_all_notifications and \message_output_popup::cleanup_read_notifications do not have fully optimized delete queries.
This
public function cleanup_all_notifications(int $notificationdeletetime): void { |
global $DB;
|
|
$DB->delete_records_select('message_popup_notifications', |
'notificationid IN (SELECT id FROM {notifications} WHERE timecreated < ?)', [$notificationdeletetime]); |
}
|
Should become this:
public function cleanup_all_notifications(int $notificationdeletetime): void { |
global $DB;
|
|
$DB->delete_records_select(
|
'message_popup_notifications', |
'EXISTS (
|
SELECT id
|
FROM {notifications}
|
WHERE timecreated < ? AND id = {message_popup_notifications}.notificationid
|
)',
|
[$notificationdeletetime]
|
);
|
}
|
|