Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-9373

Replace an indefinite number of queries with one query.

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.7, 1.7.1, 1.7.2, 1.8, 1.8.1, 1.9
    • Fix Version/s: 1.9
    • Component/s: Libraries
    • Labels:
      None
    • Environment:
      Any & all
    • Database:
      Any
    • Affected Branches:
      MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      The attached patch would replace recursive calls to the get_parent_contexts function with a single call.
      For sites with nested Course Categories, this should be an optimisation.
      For other sites, the self-joining query will have a moderate performance impact.

      Caveat lector: This is untested code.

      Martín - is this a fair representation of the approach we discussed?
      Eloy - does my revision look like it still does exactly what the existing version does?

        Attachments

          Activity

            People

            Assignee:
            stronk7 Eloy Lafuente (stronk7)
            Reporter:
            donal@catalyst.net.nz Donal McMullan
            Tester:
            Nobody
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              3/Mar/08