diff options
author | Paweł Chmielowski <pchmielowski@process-one.net> | 2018-02-26 09:43:04 +0100 |
---|---|---|
committer | Paweł Chmielowski <pchmielowski@process-one.net> | 2018-02-26 09:43:04 +0100 |
commit | 5912c573ea20eef4768adc572c358cef3e9ebc03 (patch) | |
tree | cffda16f87058fbfaf668c09d526cadabaadb6dd | |
parent | Simplify code for splitting auth string in cyrsasl (diff) |
Use length on fields in mysql indexes
-rw-r--r-- | sql/mysql.new.sql | 6 | ||||
-rw-r--r-- | sql/mysql.sql | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sql/mysql.new.sql b/sql/mysql.new.sql index 9dafe5bb2..d9c4cb915 100644 --- a/sql/mysql.new.sql +++ b/sql/mysql.new.sql @@ -113,9 +113,9 @@ CREATE TABLE archive ( ) ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE FULLTEXT INDEX i_text ON archive(txt); -CREATE INDEX i_archive_sh_username_timestamp USING BTREE ON archive(server_host(191), username, timestamp); -CREATE INDEX i_archive_sh_username_peer USING BTREE ON archive(server_host(191), username, peer); -CREATE INDEX i_archive_sh_username_bare_peer USING BTREE ON archive(server_host(191), username, bare_peer); +CREATE INDEX i_archive_sh_username_timestamp USING BTREE ON archive(server_host(191), username(191), timestamp); +CREATE INDEX i_archive_sh_username_peer USING BTREE ON archive(server_host(191), username(191), peer(191)); +CREATE INDEX i_archive_sh_username_bare_peer USING BTREE ON archive(server_host(191), username(191), bare_peer(191)); CREATE INDEX i_archive_sh_timestamp USING BTREE ON archive(server_host(191), timestamp); CREATE TABLE archive_prefs ( diff --git a/sql/mysql.sql b/sql/mysql.sql index 64d26fa87..aea9e454e 100644 --- a/sql/mysql.sql +++ b/sql/mysql.sql @@ -102,9 +102,9 @@ CREATE TABLE archive ( ) ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE FULLTEXT INDEX i_text ON archive(txt); -CREATE INDEX i_username_timestamp USING BTREE ON archive(username, timestamp); -CREATE INDEX i_username_peer USING BTREE ON archive(username, peer); -CREATE INDEX i_username_bare_peer USING BTREE ON archive(username, bare_peer); +CREATE INDEX i_username_timestamp USING BTREE ON archive(username(191), timestamp); +CREATE INDEX i_username_peer USING BTREE ON archive(username(191), peer(191)); +CREATE INDEX i_username_bare_peer USING BTREE ON archive(username(191), bare_peer(191)); CREATE INDEX i_timestamp USING BTREE ON archive(timestamp); CREATE TABLE archive_prefs ( |