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

Update PostgreSQL binary (bytea) handling and improve connection performance

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      1. All unit tests pass, this checks all the binary changes for PostgreSQL
      2. edit your config.php and ensure the following dboptions are set.

      $CFG->dboptions = array(
          'dbschema' => 'moodle',
      );
      

      3. Create a schema 'moodle' in your database.
      4. Run unit tests again to ensure that the new schema is set and tables are built in that schema.
      5. Run the attached script against public master and integration master to ensure there are no regressions in performance.

      Show
      1. All unit tests pass, this checks all the binary changes for PostgreSQL 2. edit your config.php and ensure the following dboptions are set. $CFG->dboptions = array( 'dbschema' => 'moodle', ); 3. Create a schema 'moodle' in your database. 4. Run unit tests again to ensure that the new schema is set and tables are built in that schema. 5. Run the attached script against public master and integration master to ensure there are no regressions in performance.
    • Affected Branches:
      MOODLE_31_STABLE, MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE
    • Pull Master Branch:

      Description

      PostgreSQL driver requires multiple queries when a connection to the database is made. These can be handled differently to remove the query requirement.

      PostgreSQL 9.1 is now the minimum required version, so the escape_format can be forced to the new hex format. This has performance and functionality improvements when using pg_query_params(). Functions that did not support BLOBS before can now.

      normalise_value() can now easily escape BLOBS the same as other fields. This allows a more simplified driver.

      pg_field_type() on a result does not require a db query as it's stored in the result set. So the type can be compared to bytea rather than getting the OID, having to pass it around and match it.

      get_field_sql() did not support BLOB's on PostgreSQL, even though they worked on mysql. With the new formatting they now work.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

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