diff options
author | Alexey Shchepin <alexey@process-one.net> | 2017-10-27 15:20:29 +0300 |
---|---|---|
committer | Alexey Shchepin <alexey@process-one.net> | 2017-10-27 15:20:29 +0300 |
commit | e1c8e88d87b5e1fbfeb24c9d5d06336274afde6e (patch) | |
tree | 5ede7e4bcec247a43e92e9c86c0c9dc42f7f18c7 /sql | |
parent | b6c88fb17eeffa345a36c82b691f6ff4a6f629b1 (diff) |
Update SQL archive index to match mysql.sql
Diffstat (limited to 'sql')
-rw-r--r-- | sql/lite.sql | 2 | ||||
-rw-r--r-- | sql/mssql.sql | 2 | ||||
-rw-r--r-- | sql/pg.sql | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/sql/lite.sql b/sql/lite.sql index 0789ca45a..44df0586d 100644 --- a/sql/lite.sql +++ b/sql/lite.sql @@ -97,7 +97,7 @@ CREATE TABLE archive ( created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ); -CREATE INDEX i_username ON archive(username); +CREATE INDEX i_username_timestamp ON archive(username, timestamp); CREATE INDEX i_timestamp ON archive(timestamp); CREATE INDEX i_peer ON archive(peer); CREATE INDEX i_bare_peer ON archive(bare_peer); diff --git a/sql/mssql.sql b/sql/mssql.sql index 6f309487a..f49246ec3 100644 --- a/sql/mssql.sql +++ b/sql/mssql.sql @@ -38,7 +38,7 @@ CREATE TABLE [dbo].[archive] ( )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
) TEXTIMAGE_ON [PRIMARY];
-CREATE INDEX [archive_username] ON [archive] (username)
+CREATE INDEX [archive_username_timestamp] ON [archive] (username, timestamp)
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON);
CREATE INDEX [archive_timestamp] ON [archive] (timestamp)
diff --git a/sql/pg.sql b/sql/pg.sql index e26b1111f..db46111f5 100644 --- a/sql/pg.sql +++ b/sql/pg.sql @@ -101,7 +101,7 @@ CREATE TABLE archive ( created_at TIMESTAMP NOT NULL DEFAULT now() ); -CREATE INDEX i_username ON archive USING btree (username); +CREATE INDEX i_username_timestamp ON archive USING btree (username, timestamp); CREATE INDEX i_timestamp ON archive USING btree (timestamp); CREATE INDEX i_peer ON archive USING btree (peer); CREATE INDEX i_bare_peer ON archive USING btree (bare_peer); |