diff options
author | Andreas Fischer <bantu@phpbb.com> | 2009-06-08 12:36:26 +0000 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2009-06-08 12:36:26 +0000 |
commit | 9f21f1ab5e2b70da18459ef26c14a2372bc0eb76 (patch) | |
tree | 601ec121ad656ce614751d41beaadda19773b3d2 /phpBB | |
parent | 27d4c7229d97ba25e5bd303b21f376e14550eba6 (diff) | |
download | forums-9f21f1ab5e2b70da18459ef26c14a2372bc0eb76.tar forums-9f21f1ab5e2b70da18459ef26c14a2372bc0eb76.tar.gz forums-9f21f1ab5e2b70da18459ef26c14a2372bc0eb76.tar.bz2 forums-9f21f1ab5e2b70da18459ef26c14a2372bc0eb76.tar.xz forums-9f21f1ab5e2b70da18459ef26c14a2372bc0eb76.zip |
Fix bug #44665 - Add index on log_time to the log table to prevent slowdown on boards with many log entries.
Authorised by: acydburn
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9564 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/develop/create_schema_files.php | 1 | ||||
-rw-r--r-- | phpBB/develop/mysql_upgrader.php | 1 | ||||
-rw-r--r-- | phpBB/docs/CHANGELOG.html | 1 | ||||
-rw-r--r-- | phpBB/install/database_update.php | 10 | ||||
-rw-r--r-- | phpBB/install/schemas/firebird_schema.sql | 1 | ||||
-rw-r--r-- | phpBB/install/schemas/mssql_schema.sql | 3 | ||||
-rw-r--r-- | phpBB/install/schemas/mysql_40_schema.sql | 1 | ||||
-rw-r--r-- | phpBB/install/schemas/mysql_41_schema.sql | 1 | ||||
-rw-r--r-- | phpBB/install/schemas/oracle_schema.sql | 2 | ||||
-rw-r--r-- | phpBB/install/schemas/postgres_schema.sql | 1 | ||||
-rw-r--r-- | phpBB/install/schemas/sqlite_schema.sql | 1 |
11 files changed, 21 insertions, 2 deletions
diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 52c72fc72c..d7173f6f1f 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1195,6 +1195,7 @@ function get_schema_struct() 'PRIMARY_KEY' => 'log_id', 'KEYS' => array( 'log_type' => array('INDEX', 'log_type'), + 'log_time' => array('INDEX', 'log_time'), 'forum_id' => array('INDEX', 'forum_id'), 'topic_id' => array('INDEX', 'topic_id'), 'reportee_id' => array('INDEX', 'reportee_id'), diff --git a/phpBB/develop/mysql_upgrader.php b/phpBB/develop/mysql_upgrader.php index 77341500e1..22406d1286 100644 --- a/phpBB/develop/mysql_upgrader.php +++ b/phpBB/develop/mysql_upgrader.php @@ -667,6 +667,7 @@ function get_schema_struct() 'PRIMARY_KEY' => 'log_id', 'KEYS' => array( 'log_type' => array('INDEX', 'log_type'), + 'log_time' => array('INDEX', 'log_time'), 'forum_id' => array('INDEX', 'forum_id'), 'topic_id' => array('INDEX', 'topic_id'), 'reportee_id' => array('INDEX', 'reportee_id'), diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 59ae95d0b4..952304b836 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -96,6 +96,7 @@ <li>[Fix] Various XHTML mistakes in prosilver and subsilver2. (Bugs #38555, #45505 - Patch by Raimon, #45785, #45865)</li> <li>[Fix] Move post bump information markup to the template. (Bug #34295 - Patch by bantu)</li> <li>[Change] Change the data format of the default file ACM to be more secure from tampering and have better performance.</li> + <li>[Change] Add index on log_time to the log table to prevent slowdown on boards with many log entries. (Bug #44665 - Patch by bantu)</li> <li>[Feature] Backported 3.2 captcha plugins.</li> <li>[Feature] Introduced new ACM plugins: <ul> diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index a77896c470..171a8f1fc6 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -678,8 +678,14 @@ function database_update_info() // No changes from 3.0.5-RC1 to 3.0.5 '3.0.5-RC1' => array(), - // No changes from 3.0.5 - '3.0.5' => array(), + // Changes from 3.0.5 + '3.0.5' => array( + 'add_index' => array( + LOG_TABLE => array( + 'log_time' => array('log_time'), + ), + ), + ), ); } diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index fecbc61dc1..e6041e6c32 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -526,6 +526,7 @@ CREATE TABLE phpbb_log ( ALTER TABLE phpbb_log ADD PRIMARY KEY (log_id);; CREATE INDEX phpbb_log_log_type ON phpbb_log(log_type);; +CREATE INDEX phpbb_log_log_time ON phpbb_log(log_time);; CREATE INDEX phpbb_log_forum_id ON phpbb_log(forum_id);; CREATE INDEX phpbb_log_topic_id ON phpbb_log(topic_id);; CREATE INDEX phpbb_log_reportee_id ON phpbb_log(reportee_id);; diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index 8600fdb1e0..43c4c06d2d 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -636,6 +636,9 @@ GO CREATE INDEX [log_type] ON [phpbb_log]([log_type]) ON [PRIMARY] GO +CREATE INDEX [log_time] ON [phpbb_log]([log_time]) ON [PRIMARY] +GO + CREATE INDEX [forum_id] ON [phpbb_log]([forum_id]) ON [PRIMARY] GO diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql index 146c58904c..5d3e4db7de 100644 --- a/phpBB/install/schemas/mysql_40_schema.sql +++ b/phpBB/install/schemas/mysql_40_schema.sql @@ -359,6 +359,7 @@ CREATE TABLE phpbb_log ( log_data mediumblob NOT NULL, PRIMARY KEY (log_id), KEY log_type (log_type), + KEY log_time (log_time), KEY forum_id (forum_id), KEY topic_id (topic_id), KEY reportee_id (reportee_id), diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql index 81f8266f4d..f4e6fdefdc 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -359,6 +359,7 @@ CREATE TABLE phpbb_log ( log_data mediumtext NOT NULL, PRIMARY KEY (log_id), KEY log_type (log_type), + KEY log_time (log_time), KEY forum_id (forum_id), KEY topic_id (topic_id), KEY reportee_id (reportee_id), diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index 50f3ee1f80..64e1f8b8c0 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -712,6 +712,8 @@ CREATE TABLE phpbb_log ( CREATE INDEX phpbb_log_log_type ON phpbb_log (log_type) / +CREATE INDEX phpbb_log_log_time ON phpbb_log (log_time) +/ CREATE INDEX phpbb_log_forum_id ON phpbb_log (forum_id) / CREATE INDEX phpbb_log_topic_id ON phpbb_log (topic_id) diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index 9736363104..7eccad2585 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -516,6 +516,7 @@ CREATE TABLE phpbb_log ( ); CREATE INDEX phpbb_log_log_type ON phpbb_log (log_type); +CREATE INDEX phpbb_log_log_time ON phpbb_log (log_time); CREATE INDEX phpbb_log_forum_id ON phpbb_log (forum_id); CREATE INDEX phpbb_log_topic_id ON phpbb_log (topic_id); CREATE INDEX phpbb_log_reportee_id ON phpbb_log (reportee_id); diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index 36686955a9..43f83fc989 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -349,6 +349,7 @@ CREATE TABLE phpbb_log ( ); CREATE INDEX phpbb_log_log_type ON phpbb_log (log_type); +CREATE INDEX phpbb_log_log_time ON phpbb_log (log_time); CREATE INDEX phpbb_log_forum_id ON phpbb_log (forum_id); CREATE INDEX phpbb_log_topic_id ON phpbb_log (topic_id); CREATE INDEX phpbb_log_reportee_id ON phpbb_log (reportee_id); |