MDL-53213 caching: Faster databasemeta caching for all databases.
This commit is contained in:
@@ -390,9 +390,7 @@ class pgsql_native_moodle_database extends moodle_database {
|
||||
*/
|
||||
public function get_columns($table, $usecache=true) {
|
||||
if ($usecache) {
|
||||
$properties = array('dbfamily' => $this->get_dbfamily(), 'settings' => $this->get_settings_hash());
|
||||
$cache = cache::make('core', 'databasemeta', $properties);
|
||||
if ($data = $cache->get($table)) {
|
||||
if ($data = $this->get_metacache()->get($table)) {
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
@@ -596,7 +594,7 @@ class pgsql_native_moodle_database extends moodle_database {
|
||||
pg_free_result($result);
|
||||
|
||||
if ($usecache) {
|
||||
$cache->set($table, $structure);
|
||||
$this->get_metacache()->set($table, $structure);
|
||||
}
|
||||
|
||||
return $structure;
|
||||
|
||||
Reference in New Issue
Block a user