Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 1.9.3
-
Fix Version/s: None
-
Component/s: Feedback
-
Labels:None
-
Affected Branches:MOODLE_19_STABLE
Description
I am worried about the database structure of the feedback module.
All options of questions are stored in one text field (mdl_feedback_item/presentation, separated by a pipe character.
This means that for generating a page with questions, Moodle has to search through the text fields for those pipes, which is putting a lot of stress on the database.
On a unloaded, dual core Xeon machine, generating a page with 54 questions with a lot of text in the answers takes 3 seconds. On heavy load it is a lot longer.
I suggest to set up another tabel for the questions with one record per answer.
Hi Koen,
You are right, the database-structure is not well formed. But all questions are included as plugin. All questions use the same tables. There is no mechanism to install or deinstall question-related tables.
The field what you mean is only the presentation of the question. On multichoice questions there are the options for the answers on textfield questions there is the definition of the textfield-properties and so on.
Also I can not reproduce your measurement. The following things I tested:
1. Wih a for()-loop I created a textline with 50 elements seperated by a pipe (|).
2. With a second for()-loop I created an array with 1000 elements of these created lines.
3. Now I went through this array with a foreach()-loop and used the explode()-function to extract all elements
There are 1000 explodes with 50 elements (I don't know any questionnaire with so many questions/options)
My script was needing 0.45 seconds. I tested on a VMWare-machine with a Core2Quad 2,83GHz.
Andreas