-
Bug
-
Resolution: Fixed
-
Major
-
3.10.10, 3.11.6, 4.0, 4.0.6, 4.1.1
Our DBAs have noticed that Moodle has some inefficient queries related to the user_private_key table.
The specific query they have noticed is:
SELECT u.id FROM mdl_user u |
JOIN mdl_user_private_key k ON u.id = k.userid |
WHERE u.deleted = 0 AND u.confirmed = 1 |
AND u.suspended = 0 AND k.value = 'c70d6d9e51ed81702bdfd73626ded013'; |
This query seems to be getting called when users access their RSS feeds (this example is from Moodle 3.10):
in mysqli::query called at /var/www/html/lib/dml/mysqli_native_moodle_database.php (1272)
|
in mysqli_native_moodle_database::get_records_sql called at /var/www/html/lib/dml/moodle_database.php (1671)
|
in moodle_database::get_record_sql called at /var/www/html/lib/dml/moodle_database.php (1744)
|
in moodle_database::get_field_sql called at /var/www/html/lib/rsslib.php (420)
|
in rss_get_userid_from_token called at /var/www/html/rss/file.php (111)
|
I have attached their analysis of this query.
Their recommendation is that and index is added for the value column to the table.
This suggestion would likely also increase performance of other queries, such as the one used in the creation of tokens
- is a regression caused by
-
MDL-33514 Moodle throws error when a meanwhile deleted user fetches rss feed
-
- Closed
-
- will help resolve
-
MDLSITE-7134 moodle.org site has got much slower in last week or so
-
- Resolved
-