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

Postgresql driver performance tuning

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      1. Successfully Install a new Moodle site on PostgreSQL
      2. Units test and behat tests pass on PostgreSQL

      Optionally:

      1. Copy userquerytest.php to your moodle root directory.
      2. Open a terminal and go to your mooodle root directory and run the following command.

        php userquerytest.php [NUMBER_OF_USERS_YOU_WANT]
        

        (the higher number, the better)

      3. Compare the results to before and after the patch.
        • Confirm that the results after the patch is at least the same or better than before the patch.
      Show
      1. Successfully Install a new Moodle site on PostgreSQL 2. Units test and behat tests pass on PostgreSQL Optionally: Copy userquerytest.php to your moodle root directory. Open a terminal and go to your mooodle root directory and run the following command. php userquerytest.php [NUMBER_OF_USERS_YOU_WANT] (the higher number, the better) Compare the results to before and after the patch. Confirm that the results after the patch is at least the same or better than before the patch.
    • Affected Branches:
      MOODLE_29_STABLE, MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      Sharing some changes we've made to the postgresql DB driver over the years for performance reasons.

      Most of the diff here revolves around adding the static table metadata caches back, and parsing queries for 'evil' things where we must reset to avoid stale data.

      We've also ensured redundant LIMIT/OFFSET clauses are not added to queries; this helps the planner avoid a few bad cases, especially with OFFSET 0.

      In a selection (non-sleeping) of unit tests, this patch alone cuts run time 15%.

      Similar results may occur in e.g. upgrade scripts with many calls to update_record (see MDL-48604).

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                3 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  5/Dec/16