MDL-33018 add general index type hints and use PostgreSQL varchar_pattern_ops index type for context.path

This significantly improves performance of accesslib queries,
credit for the discovery of this solution goes to Andrew Masterton from OU.
This commit is contained in:
Petr Skoda
2012-07-06 08:19:39 +02:00
committed by Petr Škoda
parent 2cbdaa77ea
commit bd991d03cf
15 changed files with 191 additions and 23 deletions
+8 -5
View File
@@ -1013,13 +1013,16 @@ abstract class sql_generator {
$results = array();
// Get the real index name
$dbindexname = $this->mdb->get_manager()->find_index_name($xmldb_table, $xmldb_index);
$dbindexnames = $this->mdb->get_manager()->find_index_name($xmldb_table, $xmldb_index, true);
// Replace TABLENAME and INDEXNAME as needed
$dropsql = str_replace('TABLENAME', $this->getTableName($xmldb_table), $this->drop_index_sql);
$dropsql = str_replace('INDEXNAME', $this->getEncQuoted($dbindexname), $dropsql);
$results[] = $dropsql;
if ($dbindexnames) {
foreach ($dbindexnames as $dbindexname) {
$dropsql = str_replace('TABLENAME', $this->getTableName($xmldb_table), $this->drop_index_sql);
$dropsql = str_replace('INDEXNAME', $this->getEncQuoted($dbindexname), $dropsql);
$results[] = $dropsql;
}
}
return $results;
}