Skip to content
Snippets Groups Projects
Commit eb2fb414 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch by Matt and chx: improved performance of taxonomy queries. When many

  terms are matched, the query would become very slow.
parent a7fa9552
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -653,7 +653,8 @@ CREATE TABLE term_node ( ...@@ -653,7 +653,8 @@ CREATE TABLE term_node (
nid int(10) unsigned NOT NULL default '0', nid int(10) unsigned NOT NULL default '0',
tid int(10) unsigned NOT NULL default '0', tid int(10) unsigned NOT NULL default '0',
KEY nid (nid), KEY nid (nid),
KEY tid (tid) KEY tid (tid),
PRIMARY KEY (tid,nid)
) TYPE=MyISAM; ) TYPE=MyISAM;
-- --
......
...@@ -649,7 +649,8 @@ CREATE INDEX term_hierarchy_parent_idx ON term_hierarchy(parent); ...@@ -649,7 +649,8 @@ CREATE INDEX term_hierarchy_parent_idx ON term_hierarchy(parent);
CREATE TABLE term_node ( CREATE TABLE term_node (
nid integer NOT NULL default '0', nid integer NOT NULL default '0',
tid integer NOT NULL default '0' tid integer NOT NULL default '0',
PRIMARY KEY (tid,nid)
); );
CREATE INDEX term_node_nid_idx ON term_node(nid); CREATE INDEX term_node_nid_idx ON term_node(nid);
CREATE INDEX term_node_tid_idx ON term_node(tid); CREATE INDEX term_node_tid_idx ON term_node(tid);
......
...@@ -103,7 +103,8 @@ ...@@ -103,7 +103,8 @@
"2005-02-11" => "update_124", "2005-02-11" => "update_124",
"2005-02-23" => "update_125", "2005-02-23" => "update_125",
"2005-03-03" => "update_126", "2005-03-03" => "update_126",
"2005-03-18" => "update_127" "2005-03-18" => "update_127",
"2005-03-21" => "update_128"
); );
function update_32() { function update_32() {
...@@ -2336,4 +2337,17 @@ function update_sql($sql) { ...@@ -2336,4 +2337,17 @@ function update_sql($sql) {
} }
} }
function update_128() {
$ret = array();
if ($GLOBALS['db_type'] == 'mysql') {
$ret[] = update_sql('ALTER TABLE {term_node} ADD PRIMARY KEY (tid,nid)');
}
elseif ($GLOBALS['db_type'] == 'pgsql') {
$ret[] = update_sql('ALTER TABLE {term_node} ADD PRIMARY KEY (tid,nid)');
}
return $ret;
}
?> ?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment