Upgrade course_sections index

Upgrade course_sections index

by Meir Shloush -
Number of replies: 0

Hello,

I'm upgrading Moodle site from 2.2 to 2.6 version.

The upgrade was stuck for 48 hours while changing course_sections index to unique index.

The change performed in this file: lib/db/upgrade.php in the "if ($oldversion < 2012042300.00) {" section.

The code does the following operations:

  1. Drop the existing ununique index for 'course - section'.
  2. Query to find duplicate entries for 'course - section'.
  3. Delete the duplicates found.
  4. Create new unique index for 'course - section'.
 

The upgrade was stuck with the second point.

When I run the same query before the index droped it took several seconds.

I wonder if the query shouldn't have to run when the index is still existing - and drop the index only before creating the new one.

Is there any problem with my suggestion?

 

Thank you in advance,

Meir

mish@openapp.co.il

Average of ratings: Useful (1)