[ticket/11103] Update indexes on notifications/user notifications tables

PHPBB3-11103
This commit is contained in:
Nathan Guse 2012-12-08 14:12:25 -06:00
parent 2227ceab8b
commit 0d6c8f46ff
9 changed files with 18 additions and 88 deletions

View file

@ -1309,13 +1309,8 @@ function get_schema_struct()
),
'PRIMARY_KEY' => 'notification_id',
'KEYS' => array(
'item_type' => array('INDEX', 'item_type'),
'item_id' => array('INDEX', 'item_id'),
'item_pid' => array('INDEX', 'item_parent_id'),
'user_id' => array('INDEX', 'user_id'),
'time' => array('INDEX', 'time'),
'unread' => array('INDEX', 'unread'),
'is_enabled' => array('INDEX', 'is_enabled'),
'item_ident' => array('INDEX', array('item_type', 'item_id')),
'user' => array('INDEX', array('user_id', 'unread')),
),
);
@ -1791,11 +1786,6 @@ function get_schema_struct()
'user_id',
'method',
),
'KEYS' => array(
'it' => array('INDEX', 'item_type'),
'uid' => array('INDEX', 'user_id'),
'no' => array('INDEX', 'notify'),
),
);
$schema_data['phpbb_user_group'] = array(

View file

@ -1122,13 +1122,8 @@ function database_update_info()
),
'PRIMARY_KEY' => 'notification_id',
'KEYS' => array(
'item_type' => array('INDEX', 'item_type'),
'item_id' => array('INDEX', 'item_id'),
'item_pid' => array('INDEX', 'item_parent_id'),
'user_id' => array('INDEX', 'user_id'),
'time' => array('INDEX', 'time'),
'unread' => array('INDEX', 'unread'),
'is_enabled' => array('INDEX', 'is_enabled'),
'item_ident' => array('INDEX', array('item_type', 'item_id')),
'user' => array('INDEX', array('user_id', 'unread')),
),
),
$table_prefix . 'user_notifications' => array(
@ -1145,11 +1140,6 @@ function database_update_info()
'user_id',
'method',
),
'KEYS' => array(
'it' => array('INDEX', 'item_type'),
'uid' => array('INDEX', 'user_id'),
'no' => array('INDEX', 'notify'),
),
),
),
'add_columns' => array(

View file

@ -633,13 +633,8 @@ CREATE TABLE phpbb_notifications (
ALTER TABLE phpbb_notifications ADD PRIMARY KEY (notification_id);;
CREATE INDEX phpbb_notifications_item_type ON phpbb_notifications(item_type);;
CREATE INDEX phpbb_notifications_item_id ON phpbb_notifications(item_id);;
CREATE INDEX phpbb_notifications_item_pid ON phpbb_notifications(item_parent_id);;
CREATE INDEX phpbb_notifications_user_id ON phpbb_notifications(user_id);;
CREATE INDEX phpbb_notifications_time ON phpbb_notifications(time);;
CREATE INDEX phpbb_notifications_unread ON phpbb_notifications(unread);;
CREATE INDEX phpbb_notifications_is_enabled ON phpbb_notifications(is_enabled);;
CREATE INDEX phpbb_notifications_item_ident ON phpbb_notifications(item_type, item_id);;
CREATE INDEX phpbb_notifications_user ON phpbb_notifications(user_id, unread);;
CREATE GENERATOR phpbb_notifications_gen;;
SET GENERATOR phpbb_notifications_gen TO 0;;

View file

@ -774,25 +774,10 @@ ALTER TABLE [phpbb_notifications] WITH NOCHECK ADD
) ON [PRIMARY]
GO
CREATE INDEX [item_type] ON [phpbb_notifications]([item_type]) ON [PRIMARY]
CREATE INDEX [item_ident] ON [phpbb_notifications]([item_type], [item_id]) ON [PRIMARY]
GO
CREATE INDEX [item_id] ON [phpbb_notifications]([item_id]) ON [PRIMARY]
GO
CREATE INDEX [item_pid] ON [phpbb_notifications]([item_parent_id]) ON [PRIMARY]
GO
CREATE INDEX [user_id] ON [phpbb_notifications]([user_id]) ON [PRIMARY]
GO
CREATE INDEX [time] ON [phpbb_notifications]([time]) ON [PRIMARY]
GO
CREATE INDEX [unread] ON [phpbb_notifications]([unread]) ON [PRIMARY]
GO
CREATE INDEX [is_enabled] ON [phpbb_notifications]([is_enabled]) ON [PRIMARY]
CREATE INDEX [user] ON [phpbb_notifications]([user_id], [unread]) ON [PRIMARY]
GO

View file

@ -442,13 +442,8 @@ CREATE TABLE phpbb_notifications (
time int(11) UNSIGNED DEFAULT '1' NOT NULL,
data blob NOT NULL,
PRIMARY KEY (notification_id),
KEY item_type (item_type),
KEY item_id (item_id),
KEY item_pid (item_parent_id),
KEY user_id (user_id),
KEY time (time),
KEY unread (unread),
KEY is_enabled (is_enabled)
KEY item_ident (item_type, item_id),
KEY user (user_id, unread)
);

View file

@ -442,13 +442,8 @@ CREATE TABLE phpbb_notifications (
time int(11) UNSIGNED DEFAULT '1' NOT NULL,
data text NOT NULL,
PRIMARY KEY (notification_id),
KEY item_type (item_type),
KEY item_id (item_id),
KEY item_pid (item_parent_id),
KEY user_id (user_id),
KEY time (time),
KEY unread (unread),
KEY is_enabled (is_enabled)
KEY item_ident (item_type, item_id),
KEY user (user_id, unread)
) CHARACTER SET `utf8` COLLATE `utf8_bin`;

View file

@ -857,19 +857,9 @@ CREATE TABLE phpbb_notifications (
)
/
CREATE INDEX phpbb_notifications_item_type ON phpbb_notifications (item_type)
CREATE INDEX phpbb_notifications_item_ident ON phpbb_notifications (item_type, item_id)
/
CREATE INDEX phpbb_notifications_item_id ON phpbb_notifications (item_id)
/
CREATE INDEX phpbb_notifications_item_pid ON phpbb_notifications (item_parent_id)
/
CREATE INDEX phpbb_notifications_user_id ON phpbb_notifications (user_id)
/
CREATE INDEX phpbb_notifications_time ON phpbb_notifications (time)
/
CREATE INDEX phpbb_notifications_unread ON phpbb_notifications (unread)
/
CREATE INDEX phpbb_notifications_is_enabled ON phpbb_notifications (is_enabled)
CREATE INDEX phpbb_notifications_user ON phpbb_notifications (user_id, unread)
/
CREATE SEQUENCE phpbb_notifications_seq

View file

@ -614,13 +614,8 @@ CREATE TABLE phpbb_notifications (
PRIMARY KEY (notification_id)
);
CREATE INDEX phpbb_notifications_item_type ON phpbb_notifications (item_type);
CREATE INDEX phpbb_notifications_item_id ON phpbb_notifications (item_id);
CREATE INDEX phpbb_notifications_item_pid ON phpbb_notifications (item_parent_id);
CREATE INDEX phpbb_notifications_user_id ON phpbb_notifications (user_id);
CREATE INDEX phpbb_notifications_time ON phpbb_notifications (time);
CREATE INDEX phpbb_notifications_unread ON phpbb_notifications (unread);
CREATE INDEX phpbb_notifications_is_enabled ON phpbb_notifications (is_enabled);
CREATE INDEX phpbb_notifications_item_ident ON phpbb_notifications (item_type, item_id);
CREATE INDEX phpbb_notifications_user ON phpbb_notifications (user_id, unread);
/*
Table: 'phpbb_poll_options'

View file

@ -430,13 +430,8 @@ CREATE TABLE phpbb_notifications (
data text(65535) NOT NULL DEFAULT ''
);
CREATE INDEX phpbb_notifications_item_type ON phpbb_notifications (item_type);
CREATE INDEX phpbb_notifications_item_id ON phpbb_notifications (item_id);
CREATE INDEX phpbb_notifications_item_pid ON phpbb_notifications (item_parent_id);
CREATE INDEX phpbb_notifications_user_id ON phpbb_notifications (user_id);
CREATE INDEX phpbb_notifications_time ON phpbb_notifications (time);
CREATE INDEX phpbb_notifications_unread ON phpbb_notifications (unread);
CREATE INDEX phpbb_notifications_is_enabled ON phpbb_notifications (is_enabled);
CREATE INDEX phpbb_notifications_item_ident ON phpbb_notifications (item_type, item_id);
CREATE INDEX phpbb_notifications_user ON phpbb_notifications (user_id, unread);
# Table: 'phpbb_poll_options'
CREATE TABLE phpbb_poll_options (