Details
-
Type:
Sub-task
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Duplicate
-
Affects Version/s: 1.9.9, 2.0.1
-
Fix Version/s: STABLE Sprint 4
-
Component/s: Performance
-
Labels:
-
Database:Any
-
Difficulty:Easy
-
Affected Branches:MOODLE_19_STABLE, MOODLE_20_STABLE
Description
Some tasks in Moodle that use the custom user profile fields could be greatly improved by the addition of a database index on the 'userid' and 'fieldid' fields. It would also be great to have one on the 'data' field, but this is not possible as it is a 'text' type and will not work on all database technologies.
Simply adding a new index such as 'userfieldidx' based on the 'userid' and 'fieldid' fields can speed up a number of queries.
I have attached a patch (would need adjusting for the version bump) that would do this. This could (should) be applied to 2.0 as well.
Attachments
Issue Links
| This issue duplicates: | ||||
| MDL-17201 | Add index on user_info_data |
|
|
|
Hi Mike,
I think you've added the wrong upgrade code here - looks like you're adding a new id field rather than the index - I've just checked 2.0 and the id field exists - is it missing in 1.9?