diff --git a/lib/db/install.xml b/lib/db/install.xml index fcef7da2b25..9a30e74c4f5 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -461,6 +461,8 @@ + + diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 4c56b3969c5..a80612c7341 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -2145,5 +2145,22 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2019122000.01); } + if ($oldversion < 2020010900.02) { + $table = new xmldb_table('event'); + + // This index will improve the performance when the Events API retrieves category and group events. + $index = new xmldb_index('eventtype', XMLDB_INDEX_NOTUNIQUE, ['eventtype']); + if (!$dbman->index_exists($table, $index)) { + $dbman->add_index($table, $index); + } + + // This index improves the performance of backups, deletion and visibilty changes on activities. + $index = new xmldb_index('modulename-instance', XMLDB_INDEX_NOTUNIQUE, ['modulename', 'instance']); + if (!$dbman->index_exists($table, $index)) { + $dbman->add_index($table, $index); + } + + upgrade_main_savepoint(true, 2020010900.02); + } return true; } diff --git a/version.php b/version.php index 710eac05aad..ec99292c317 100644 --- a/version.php +++ b/version.php @@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2020010900.00; // YYYYMMDD = weekly release date of this DEV branch. +$version = 2020010900.01; // YYYYMMDD = weekly release date of this DEV branch. // RR = release increments - 00 in DEV branches. // .XX = incremental changes. $release = '3.9dev (Build: 20200109)'; // Human-friendly version name