Added lower indexes for postgresql to tags.tag and users.name to speed up queries for them using lower()
This commit is contained in:
parent
a834d1f814
commit
d128dfa78e
1 changed files with 14 additions and 0 deletions
|
@ -129,6 +129,20 @@ class Upgrade extends Extension
|
||||||
log_info("upgrade", "Database at version 14");
|
log_info("upgrade", "Database at version 14");
|
||||||
$config->set_bool("in_upgrade", false);
|
$config->set_bool("in_upgrade", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($config->get_int("db_version") < 15) {
|
||||||
|
$config->set_bool("in_upgrade", true);
|
||||||
|
$config->set_int("db_version", 15);
|
||||||
|
|
||||||
|
log_info("upgrade", "Adding lower indexes for postgresql use");
|
||||||
|
if ($database->get_driver_name() == Database::PGSQL_DRIVER) {
|
||||||
|
$database->execute('CREATE INDEX tags_lower_tag_idx ON tags ((lower(tag)))');
|
||||||
|
$database->execute('CREATE INDEX users_lower_name_idx ON users ((lower(name)))');
|
||||||
|
}
|
||||||
|
|
||||||
|
log_info("upgrade", "Database at version 15");
|
||||||
|
$config->set_bool("in_upgrade", false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function get_priority(): int
|
public function get_priority(): int
|
||||||
|
|
Reference in a new issue