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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user