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

Update PostgreSQL binary (bytea) handling and improve connection performance

    XMLWordPrintable

Details

    • MOODLE_31_STABLE, MOODLE_32_STABLE
    • MOODLE_32_STABLE
    • 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.

    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

              mr-russ Russell Smith
              mr-russ Russell Smith
              Adrian Greeve Adrian Greeve
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Rajesh Taneja Rajesh Taneja
              Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo, Matteo Scaramuccia, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo
              Votes:
              3 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                5/Dec/16