MDL-50805 Messages: Add index to message_read to speed up message crons
This commit is contained in:
@@ -569,6 +569,7 @@
|
||||
<INDEXES>
|
||||
<INDEX NAME="useridto" UNIQUE="false" FIELDS="useridto"/>
|
||||
<INDEX NAME="useridfromtodeleted" UNIQUE="false" FIELDS="useridfrom, useridto, timeuserfromdeleted, timeusertodeleted"/>
|
||||
<INDEX NAME="notificationtimeread" UNIQUE="false" FIELDS="notification, timeread"/>
|
||||
</INDEXES>
|
||||
</TABLE>
|
||||
<TABLE NAME="message_contacts" COMMENT="Maintains lists of relationships between users">
|
||||
|
||||
@@ -4572,5 +4572,20 @@ function xmldb_main_upgrade($oldversion) {
|
||||
upgrade_main_savepoint(true, 2015092200.00);
|
||||
}
|
||||
|
||||
if ($oldversion < 2015100100.00) {
|
||||
|
||||
// Define index notification (not unique) to be added to message_read.
|
||||
$table = new xmldb_table('message_read');
|
||||
$index = new xmldb_index('notificationtimeread', XMLDB_INDEX_NOTUNIQUE, array('notification', 'timeread'));
|
||||
|
||||
// Conditionally launch add index notification.
|
||||
if (!$dbman->index_exists($table, $index)) {
|
||||
$dbman->add_index($table, $index);
|
||||
}
|
||||
|
||||
// Main savepoint reached.
|
||||
upgrade_main_savepoint(true, 2015100100.00);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$version = 2015092400.00; // YYYYMMDD = weekly release date of this DEV branch.
|
||||
$version = 2015100100.00; // YYYYMMDD = weekly release date of this DEV branch.
|
||||
// RR = release increments - 00 in DEV branches.
|
||||
// .XX = incremental changes.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user