diff --git a/config-dist.php b/config-dist.php index 5308052c915..0803045c7a7 100644 --- a/config-dist.php +++ b/config-dist.php @@ -73,12 +73,15 @@ $CFG->dboptions = array( // 'fetchbuffersize' => 100000, // On PostgreSQL, this option sets a limit // on the number of rows that are fetched into // memory when doing a large recordset query - // (e.g. search indexing). Default is 100000. - // Uncomment and set to a value to change it, - // or zero to turn off the limit. You need to - // set to zero if you are using pg_bouncer in - // 'transaction' mode (it is fine in 'session' - // mode). + // (e.g. search indexing). + // By default, this feature is disabled in + // Moodle 3.4, using a value of zero. In Moodle + // 3.5 and up the feature is enabled by default + // with a buffer size of 100000. + // Uncomment and set a positive value to enable it, + // noting that you need to keep it to zero + // if you are using pg_bouncer in 'transaction' + // mode (it is fine in 'session' mode). ); diff --git a/lib/dml/pgsql_native_moodle_database.php b/lib/dml/pgsql_native_moodle_database.php index ae7550175e4..7e87010556e 100644 --- a/lib/dml/pgsql_native_moodle_database.php +++ b/lib/dml/pgsql_native_moodle_database.php @@ -48,9 +48,6 @@ class pgsql_native_moodle_database extends moodle_database { /** @var int Number of cursors used (for constructing a unique ID) */ protected $cursorcount = 0; - /** @var int Default number of rows to fetch at a time when using recordsets with cursors */ - const DEFAULT_FETCH_BUFFER_SIZE = 100000; - /** * Detects if all needed PHP stuff installed. * Note: can be used before connect() @@ -782,7 +779,7 @@ class pgsql_native_moodle_database extends moodle_database { if (array_key_exists('fetchbuffersize', $this->dboptions)) { return (int)$this->dboptions['fetchbuffersize']; } else { - return self::DEFAULT_FETCH_BUFFER_SIZE; + return 0; // Disabled by default. } }