Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.9.4
-
Component/s: Database SQL/XMLDB
-
Labels:None
-
Affected Branches:MOODLE_19_STABLE
-
Fixed Branches:MOODLE_19_STABLE, MOODLE_20_STABLE
Description
Inside course/lib.php:print_category_info(), there's the following query:
$coursecount = count_records('course') <= FRONTPAGECOURSELIMIT;
This unfortunately gets run every time we recurse into another category, but it really only needs to be checked once.
It can have a very big impact on a site which uses lots of categories and nested ones too. On one site, this has taken the number of queries on the front page from 383 down to 223.
The attached patch is against 1.9.
Attachments
Activity
- All
- Comments
- History
- Activity
- Source
- Test Sessions
Checked it out, good spotting, 1_9 and HEAD both fine. Thanks