-
Bug
-
Resolution: Fixed
-
Minor
-
3.5.2, 3.5.5, 3.6.3
-
MOODLE_35_STABLE, MOODLE_36_STABLE
-
MOODLE_35_STABLE, MOODLE_36_STABLE
-
MDL-65008_master -
The class \backup_questions_structure_step found in backup/moodle2/backup_stepslib.php has a DB query for getting the tag instances associated with a question:
$tag->set_source_sql("SELECT t.id, ti.contextid, t.name, t.rawname
|
FROM {tag} t
|
JOIN {tag_instance} ti ON ti.tagid = t.id
|
WHERE ti.itemid = ?
|
AND ti.itemtype = 'question'", array(backup::VAR_PARENTID));
|
This query seems to be costly because it's not using a better index. You can test when running EXPLAIN:
After some digging, the taglookup index is used if the component is specified: