-
Sub-task
-
Resolution: Fixed
-
Minor
-
2.5
The course format code makes an unnecessary get_record call on the course table for courses which are normally already loaded in memory: $COURSE and $SITE.
Although this is only likely to be two queries per page, it is still worth saving two queries. Additionally, course table rows are quite large (typically in the 100KB range, with our largest being over a megabyte) so the queries may waste a bit of resources.
It's only the course format that does this on every page. However, as this may be a more general issue, I suggest creating a get_course API to do it properly.
I suggest this might be suitable for 2.5.1, or 2.6 if necessary. (At the OU we have already solved this problem because we use a custom database driver so we put the logic into there.)