MDL-34933 core_message: Adding index to improve database access on message_working table.

This commit is contained in:
Mike Churchward
2013-04-22 08:38:03 -04:00
parent 931eff3b84
commit d75a987e36
3 changed files with 18 additions and 1 deletions
+3
View File
@@ -2363,6 +2363,9 @@
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the table, please edit me"/>
</KEYS>
<INDEXES>
<INDEX NAME="unreadmessageid_idx" UNIQUE="false" FIELDS="unreadmessageid" COMMENT="Index on unreadmessage id"/>
</INDEXES>
</TABLE>
<TABLE NAME="files" COMMENT="description of files, content is stored in sha1 file pool" PREVIOUS="message_working" NEXT="files_reference">
<FIELDS>
+14
View File
@@ -1687,5 +1687,19 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2012120303.02);
}
if ($oldversion < 2012120303.06) {
// Adding index to unreadmessageid field of message_working table (MDL-34933)
$table = new xmldb_table('message_working');
$index = new xmldb_index('unreadmessageid_idx', XMLDB_INDEX_NOTUNIQUE, array('unreadmessageid'));
// Conditionally launch add index unreadmessageid
if (!$dbman->index_exists($table, $index)) {
$dbman->add_index($table, $index);
}
// Main savepoint reached.
upgrade_main_savepoint(true, 2012120303.06);
}
return true;
}
+1 -1
View File
@@ -30,7 +30,7 @@
defined('MOODLE_INTERNAL') || die();
$version = 2012120303.05; // 20121203 = branching date YYYYMMDD - do not modify!
$version = 2012120303.06; // 20121203 = branching date YYYYMMDD - do not modify!
// RR = release increments - 00 in DEV branches
// .XX = incremental changes