aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2007-03-04 16:05:17 +0000
committerNils Adermann <naderman@naderman.de>2007-03-04 16:05:17 +0000
commitac21b7d47b4c8783a41ba4dbf8d26971c252c6d1 (patch)
tree8110ad6a167a84c7c6d0a849ec9fa645ed5b1178 /phpBB/install
parent567b01302b735c03e596be1b1b7d01261084c62b (diff)
downloadforums-ac21b7d47b4c8783a41ba4dbf8d26971c252c6d1.tar
forums-ac21b7d47b4c8783a41ba4dbf8d26971c252c6d1.tar.gz
forums-ac21b7d47b4c8783a41ba4dbf8d26971c252c6d1.tar.bz2
forums-ac21b7d47b4c8783a41ba4dbf8d26971c252c6d1.tar.xz
forums-ac21b7d47b4c8783a41ba4dbf8d26971c252c6d1.zip
- added a UNIQUE index on the wordmatch table
- some modifications of search indexing which might improve the speed and hopefully fixes [Bug #8352] - added logging to search indexing [Bug #8384] git-svn-id: file:///svn/phpbb/trunk@7119 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/install')
-rw-r--r--phpBB/install/database_update.php5
-rw-r--r--phpBB/install/schemas/firebird_schema.sql1
-rw-r--r--phpBB/install/schemas/mssql_schema.sql3
-rw-r--r--phpBB/install/schemas/mysql_40_schema.sql1
-rw-r--r--phpBB/install/schemas/mysql_41_schema.sql1
-rw-r--r--phpBB/install/schemas/oracle_schema.sql3
-rw-r--r--phpBB/install/schemas/postgres_schema.sql1
-rw-r--r--phpBB/install/schemas/sqlite_schema.sql1
8 files changed, 14 insertions, 2 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 1427ab69fe..b6b8e1f352 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -369,7 +369,10 @@ $database_update_info = array(
),
// Add the following unique indexes
'add_unique_index' => array(
- USERS_TABLE => array(
+ SEARCH_WORDMATCH_TABLE => array(
+ 'unique_match' => array('word_id', 'post_id', 'title_match'),
+ ),
+ USERS_TABLE => array(
'username_clean' => array('username_clean'),
),
),
diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql
index 6fb0318cf2..00df42ac39 100644
--- a/phpBB/install/schemas/firebird_schema.sql
+++ b/phpBB/install/schemas/firebird_schema.sql
@@ -949,6 +949,7 @@ CREATE TABLE phpbb_search_wordmatch (
title_match INTEGER DEFAULT 0 NOT NULL
);;
+CREATE UNIQUE INDEX phpbb_search_wordmatch_unique_match ON phpbb_search_wordmatch(word_id, post_id, title_match);;
CREATE INDEX phpbb_search_wordmatch_word_id ON phpbb_search_wordmatch(word_id);;
CREATE INDEX phpbb_search_wordmatch_post_id ON phpbb_search_wordmatch(post_id);;
diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql
index e6da562358..8ef4c97c0d 100644
--- a/phpBB/install/schemas/mssql_schema.sql
+++ b/phpBB/install/schemas/mssql_schema.sql
@@ -1123,6 +1123,9 @@ CREATE TABLE [phpbb_search_wordmatch] (
) ON [PRIMARY]
GO
+CREATE UNIQUE INDEX [unique_match] ON [phpbb_search_wordmatch]([word_id], [post_id], [title_match]) ON [PRIMARY]
+GO
+
CREATE INDEX [word_id] ON [phpbb_search_wordmatch]([word_id]) ON [PRIMARY]
GO
diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql
index 37eaa095ce..1402ef4303 100644
--- a/phpBB/install/schemas/mysql_40_schema.sql
+++ b/phpBB/install/schemas/mysql_40_schema.sql
@@ -648,6 +648,7 @@ CREATE TABLE phpbb_search_wordmatch (
post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
word_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
title_match tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ UNIQUE unique_match (word_id, post_id, title_match),
KEY word_id (word_id),
KEY post_id (post_id)
);
diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql
index 0b4a2ce1d5..5362dbfdc5 100644
--- a/phpBB/install/schemas/mysql_41_schema.sql
+++ b/phpBB/install/schemas/mysql_41_schema.sql
@@ -648,6 +648,7 @@ CREATE TABLE phpbb_search_wordmatch (
post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
word_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
title_match tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ UNIQUE unique_match (word_id, post_id, title_match),
KEY word_id (word_id),
KEY post_id (post_id)
) CHARACTER SET `utf8` COLLATE `utf8_bin`;
diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql
index 4e5cbb3da0..b6d8bd7ac1 100644
--- a/phpBB/install/schemas/oracle_schema.sql
+++ b/phpBB/install/schemas/oracle_schema.sql
@@ -1260,7 +1260,8 @@ END;
CREATE TABLE phpbb_search_wordmatch (
post_id number(8) DEFAULT '0' NOT NULL,
word_id number(8) DEFAULT '0' NOT NULL,
- title_match number(1) DEFAULT '0' NOT NULL
+ title_match number(1) DEFAULT '0' NOT NULL,
+ CONSTRAINT u_phpbb_unique_match UNIQUE (word_id, post_id, title_match)
)
/
diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql
index f33fd7ec07..663f26cbed 100644
--- a/phpBB/install/schemas/postgres_schema.sql
+++ b/phpBB/install/schemas/postgres_schema.sql
@@ -862,6 +862,7 @@ CREATE TABLE phpbb_search_wordmatch (
title_match INT2 DEFAULT '0' NOT NULL CHECK (title_match >= 0)
);
+CREATE UNIQUE INDEX phpbb_search_wordmatch_unique_match ON phpbb_search_wordmatch (word_id, post_id, title_match);
CREATE INDEX phpbb_search_wordmatch_word_id ON phpbb_search_wordmatch (word_id);
CREATE INDEX phpbb_search_wordmatch_post_id ON phpbb_search_wordmatch (post_id);
diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql
index 2a1875945f..a8620234b3 100644
--- a/phpBB/install/schemas/sqlite_schema.sql
+++ b/phpBB/install/schemas/sqlite_schema.sql
@@ -628,6 +628,7 @@ CREATE TABLE phpbb_search_wordmatch (
title_match INTEGER UNSIGNED NOT NULL DEFAULT '0'
);
+CREATE UNIQUE INDEX phpbb_search_wordmatch_unique_match ON phpbb_search_wordmatch (word_id, post_id, title_match);
CREATE INDEX phpbb_search_wordmatch_word_id ON phpbb_search_wordmatch (word_id);
CREATE INDEX phpbb_search_wordmatch_post_id ON phpbb_search_wordmatch (post_id);