- Patch #42463: performance improvement: add index on the source field of the locale table.
parent
d5aae21fa2
commit
163f1accd9
|
@ -19,7 +19,8 @@ function locale_install() {
|
||||||
lid int NOT NULL auto_increment,
|
lid int NOT NULL auto_increment,
|
||||||
location varchar(255) NOT NULL default '',
|
location varchar(255) NOT NULL default '',
|
||||||
source blob NOT NULL,
|
source blob NOT NULL,
|
||||||
PRIMARY KEY (lid)
|
PRIMARY KEY (lid),
|
||||||
|
KEY source (source(30))
|
||||||
) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
|
) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
|
||||||
|
|
||||||
db_query("CREATE TABLE {locales_target} (
|
db_query("CREATE TABLE {locales_target} (
|
||||||
|
@ -63,6 +64,7 @@ function locale_install() {
|
||||||
db_query("CREATE INDEX {locales_target}_locale_idx ON {locales_target} (locale)");
|
db_query("CREATE INDEX {locales_target}_locale_idx ON {locales_target} (locale)");
|
||||||
db_query("CREATE INDEX {locales_target}_plid_idx ON {locales_target} (plid)");
|
db_query("CREATE INDEX {locales_target}_plid_idx ON {locales_target} (plid)");
|
||||||
db_query("CREATE INDEX {locales_target}_plural_idx ON {locales_target} (plural)");
|
db_query("CREATE INDEX {locales_target}_plural_idx ON {locales_target} (plural)");
|
||||||
|
db_query("CREATE INDEX {locales_source}_source_idx ON {locales_source} (source)");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
db_query("INSERT INTO {locales_meta} (locale, name, enabled, isdefault) VALUES ('en', 'English', '1', '1')");
|
db_query("INSERT INTO {locales_meta} (locale, name, enabled, isdefault) VALUES ('en', 'English', '1', '1')");
|
||||||
|
|
|
@ -3090,6 +3090,23 @@ function system_update_1007() {
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Performance update for queries that are related to the locale.module
|
||||||
|
*/
|
||||||
|
function system_update_1008() {
|
||||||
|
$ret = array();
|
||||||
|
switch ($GLOBALS['db_type']) {
|
||||||
|
case 'mysql':
|
||||||
|
case 'mysqli':
|
||||||
|
$ret[] = update_sql('ALTER TABLE {locales_source} ADD KEY source (source(30))');
|
||||||
|
break;
|
||||||
|
case 'pgsql':
|
||||||
|
$ret[] = update_sql("CREATE INDEX {locales_source}_source_idx on {locales_source} (source)");
|
||||||
|
}
|
||||||
|
|
||||||
|
return $ret;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @} End of "defgroup updates-4.7-to-x.x"
|
* @} End of "defgroup updates-4.7-to-x.x"
|
||||||
* The next series of updates should start at 2000.
|
* The next series of updates should start at 2000.
|
||||||
|
|
Loading…
Reference in New Issue