Skip to content

Commit

Permalink
Dev: Add database index for hash column
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Jun 15, 2017
1 parent 204a24c commit 8f0f230
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion installer/sql/create-mssql.sql
Expand Up @@ -607,8 +607,9 @@ CREATE TABLE prefix_notifications (
PRIMARY KEY ([id])
);
CREATE INDEX [notif_index] ON [prefix_notifications] ([entity_id],[entity],[status]);
CREATE INDEX [notif_hash_index ] ON [prefix_notifications] ([hash]);

--
-- Version Info
--
INSERT INTO [prefix_settings_global] VALUES ('DBVersion', '262');
INSERT INTO [prefix_settings_global] VALUES ('DBVersion', '263');
5 changes: 3 additions & 2 deletions installer/sql/create-mysql.sql
Expand Up @@ -611,10 +611,11 @@ CREATE TABLE IF NOT EXISTS `prefix_notifications` (
`first_read` DATETIME DEFAULT NULL,
`hash` VARCHAR(64) DEFAULT '',
PRIMARY KEY (`id`),
INDEX(`entity`, `entity_id`, `status`)
INDEX(`entity`, `entity_id`, `status`),
INDEX(`hash`)
) ENGINE=MYISAM CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

--
-- Version Info
--
INSERT INTO `prefix_settings_global` VALUES ('DBVersion', '262');
INSERT INTO `prefix_settings_global` VALUES ('DBVersion', '263');
3 changes: 2 additions & 1 deletion installer/sql/create-pgsql.sql
Expand Up @@ -616,8 +616,9 @@ CREATE TABLE prefix_notifications (
CONSTRAINT prefix_notifications_pkey PRIMARY KEY (id)
);
CREATE INDEX prefix_index ON prefix_notifications USING btree (entity, entity_id, status);
CREATE INDEX notif_hash_index ON prefix_notifications USING btree (hash);

--
-- Version Info
--
INSERT INTO prefix_settings_global VALUES ('DBVersion', '262');
INSERT INTO prefix_settings_global VALUES ('DBVersion', '263');

0 comments on commit 8f0f230

Please sign in to comment.