MDL-53213 caching: Faster databasemeta caching for all databases.

This commit is contained in:
Russell Smith
2016-02-28 17:03:14 +11:00
parent 03b8b55f10
commit d22a01fd99
11 changed files with 109 additions and 127 deletions
+2 -4
View File
@@ -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;