Moodle

Some modname_extend_settings_navigation() waste DB queries while they do not need to

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.0
  • Fix Version/s: 2.0
  • Component/s: Performance
  • Labels:
    None
  • Difficulty:
    Easy
  • Affected Branches:
    MOODLE_20_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

I just noticed some modules call $DB->get_record() inside their {modname}_extend_settings_navigation() and I think it is not necessary. For example, mod/glossary does not need this as its id can be taken from $PAGE->cm->instance. If this is common case, it saves us at least one query per every module in the course.

Activity

Hide
Sam Hemelryk added a comment -

Thanks for spotting this wasted DB query David. I have now gone through all of the modules and ensured all DB queries were required and cleaned up any where we already had the required information.

Show
Sam Hemelryk added a comment - Thanks for spotting this wasted DB query David. I have now gone through all of the modules and ensured all DB queries were required and cleaned up any where we already had the required information.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: