-
Bug
-
Resolution: Fixed
-
Critical
-
4.0
-
MOODLE_400_STABLE
-
MOODLE_400_STABLE
-
master_
MDL-73763_index-fix -
Currently, for question_references we have
<KEY NAME="primary" TYPE="primary" FIELDS="id"/> |
<KEY NAME="usingcontextid" TYPE="foreign" FIELDS="usingcontextid" REFTABLE="context" REFFIELDS="id"/> |
<KEY NAME="questionbankentryid" TYPE="foreign" FIELDS="questionbankentryid" REFTABLE="question_bank_entries" REFFIELDS="id"/> |
Those are right, but for performance/correctness, there should also be a unique index on
(usingcontextid, component, questionarea, itemid)
Arguably, there should also be a foreign key of (questionbankentryid, version) pointing at question_versions.
And for question_set_references
<KEY NAME="primary" TYPE="primary" FIELDS="id"/> |
<KEY NAME="usingcontextid" TYPE="foreign" FIELDS="usingcontextid" REFTABLE="context" REFFIELDS="id"/> |
<KEY NAME="questionscontextid" TYPE="foreign" FIELDS="questionscontextid" REFTABLE="context" REFFIELDS="id"/> |
Those are right, but for performance/correctness, there should also be a unique index on
(usingcontextid, component, questionarea, itemid)
- blocks
-
MDL-74255 Quiz 4.0: 'Always latest' version for a question in a quiz should mean 'latest ready version'
-
- Closed
-