diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php
index b9017937c8..77c8f8217b 100644
--- a/phpBB/develop/create_schema_files.php
+++ b/phpBB/develop/create_schema_files.php
@@ -1869,6 +1869,7 @@ function get_schema_struct()
'PRIMARY_KEY' => 'user_id',
'KEYS' => array(
'user_birthday' => array('INDEX', 'user_birthday'),
+ 'user_regdate' => array('INDEX', 'user_regdate'),
'user_email_hash' => array('INDEX', 'user_email_hash'),
'user_type' => array('INDEX', 'user_type'),
'username_clean' => array('UNIQUE', 'username_clean'),
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index abd7719c0d..940a80002c 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -241,6 +241,7 @@
[Change] Resize oversized Topic icons (Bug #44415)
[Change] Banned IPs are now sorted (Bug #43045 - Patch by DavidIQ)
[Change] phpBB updater now skips sole whitespace changes. This reduces the chance of conflicts tremendously.
+ [Change] Add index on user_regdate to the users table.
[Feature] Add language selection on the registration terms page (Bug #15085 - Patch by leviatan21)
[Feature] Backported 3.2 captcha plugins.
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index ab22c803ee..54586c5650 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -877,6 +877,9 @@ function database_update_info()
POSTS_TABLE => array(
'post_username' => array('post_username'),
),
+ USERS_TABLE => array(
+ 'user_regdate' => array('user_regdate'),
+ ),
),
),
);
diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql
index f3defe9a54..91bd7263ce 100644
--- a/phpBB/install/schemas/firebird_schema.sql
+++ b/phpBB/install/schemas/firebird_schema.sql
@@ -1381,6 +1381,7 @@ CREATE TABLE phpbb_users (
ALTER TABLE phpbb_users ADD PRIMARY KEY (user_id);;
CREATE INDEX phpbb_users_user_birthday ON phpbb_users(user_birthday);;
+CREATE INDEX phpbb_users_user_regdate ON phpbb_users(user_regdate);;
CREATE INDEX phpbb_users_user_email_hash ON phpbb_users(user_email_hash);;
CREATE INDEX phpbb_users_user_type ON phpbb_users(user_type);;
CREATE UNIQUE INDEX phpbb_users_username_clean ON phpbb_users(username_clean);;
diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql
index ac7c0928cd..c2af273edd 100644
--- a/phpBB/install/schemas/mssql_schema.sql
+++ b/phpBB/install/schemas/mssql_schema.sql
@@ -1666,6 +1666,9 @@ GO
CREATE INDEX [user_birthday] ON [phpbb_users]([user_birthday]) ON [PRIMARY]
GO
+CREATE INDEX [user_regdate] ON [phpbb_users]([user_regdate]) ON [PRIMARY]
+GO
+
CREATE INDEX [user_email_hash] ON [phpbb_users]([user_email_hash]) ON [PRIMARY]
GO
diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql
index 4fcead787b..ff5653a812 100644
--- a/phpBB/install/schemas/mysql_40_schema.sql
+++ b/phpBB/install/schemas/mysql_40_schema.sql
@@ -978,6 +978,7 @@ CREATE TABLE phpbb_users (
user_reminded_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
PRIMARY KEY (user_id),
KEY user_birthday (user_birthday),
+ KEY user_regdate (user_regdate),
KEY user_email_hash (user_email_hash),
KEY user_type (user_type),
UNIQUE username_clean (username_clean(255))
diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql
index 34adf5674e..ceb13aa102 100644
--- a/phpBB/install/schemas/mysql_41_schema.sql
+++ b/phpBB/install/schemas/mysql_41_schema.sql
@@ -978,6 +978,7 @@ CREATE TABLE phpbb_users (
user_reminded_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
PRIMARY KEY (user_id),
KEY user_birthday (user_birthday),
+ KEY user_regdate (user_regdate),
KEY user_email_hash (user_email_hash),
KEY user_type (user_type),
UNIQUE username_clean (username_clean)
diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql
index 15692ea984..6855e6472f 100644
--- a/phpBB/install/schemas/oracle_schema.sql
+++ b/phpBB/install/schemas/oracle_schema.sql
@@ -1804,6 +1804,8 @@ CREATE TABLE phpbb_users (
CREATE INDEX phpbb_users_user_birthday ON phpbb_users (user_birthday)
/
+CREATE INDEX phpbb_users_user_regdate ON phpbb_users (user_regdate)
+/
CREATE INDEX phpbb_users_user_email_hash ON phpbb_users (user_email_hash)
/
CREATE INDEX phpbb_users_user_type ON phpbb_users (user_type)
diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql
index 46e77e64b4..1c0acc4bd4 100644
--- a/phpBB/install/schemas/postgres_schema.sql
+++ b/phpBB/install/schemas/postgres_schema.sql
@@ -1243,6 +1243,7 @@ CREATE TABLE phpbb_users (
);
CREATE INDEX phpbb_users_user_birthday ON phpbb_users (user_birthday);
+CREATE INDEX phpbb_users_user_regdate ON phpbb_users (user_regdate);
CREATE INDEX phpbb_users_user_email_hash ON phpbb_users (user_email_hash);
CREATE INDEX phpbb_users_user_type ON phpbb_users (user_type);
CREATE UNIQUE INDEX phpbb_users_username_clean ON phpbb_users (username_clean);
diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql
index d754219cdf..53fe3d978a 100644
--- a/phpBB/install/schemas/sqlite_schema.sql
+++ b/phpBB/install/schemas/sqlite_schema.sql
@@ -949,6 +949,7 @@ CREATE TABLE phpbb_users (
);
CREATE INDEX phpbb_users_user_birthday ON phpbb_users (user_birthday);
+CREATE INDEX phpbb_users_user_regdate ON phpbb_users (user_regdate);
CREATE INDEX phpbb_users_user_email_hash ON phpbb_users (user_email_hash);
CREATE INDEX phpbb_users_user_type ON phpbb_users (user_type);
CREATE UNIQUE INDEX phpbb_users_username_clean ON phpbb_users (username_clean);