We were running an E-Assessment with random questions from a big question pool and taxonomies for the first time and observed extremely degraded performance on our ILIAS system.
It turned out that adding an Index to tax_tree.child substantially improved performance. On an idle system with about 80 questions, invoking the test took about 5s. With 70 participants, ILIAS was unresponsive for about 5 to 10 minutes.
Benchmarking the issue, we found the following query:
The query execution plan looked like this:
After running
the query execution plan was:
and benchmark resulted in a total query time of 0.55s
Do you think it's worth submitting a pull request?
Cheers, Felix
It turned out that adding an Index to tax_tree.child substantially improved performance. On an idle system with about 80 questions, invoking the test took about 5s. With 70 participants, ILIAS was unresponsive for about 5 to 10 minutes.
Benchmarking the issue, we found the following query:
SELECT
s.child
FROM
tax_tree s, tax_tree t
WHERE
t.child = 8385
AND
s.lft > t.lft
AND
s.rgt < t.rgt
AND
s.tax_tree_id = 18710;
The query execution plan looked like this:
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE s ref PRIMARY PRIMARY 4 const 59
1 SIMPLE t ALL NULL NULL NULL NULL 2571 Using where
After running
CREATE INDEX IF NOT EXISTS IDX_CHILD ON tax_tree (child) USING HASH;
the query execution plan was:
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t ref IDX_CHILD IDX_CHILD 4 const 1
1 SIMPLE s ref PRIMARY PRIMARY 4 const 59 Using where
and benchmark resulted in a total query time of 0.55s
Do you think it's worth submitting a pull request?
Cheers, Felix