diff options
author | Christopher Speller <crspeller@gmail.com> | 2017-10-27 06:02:16 -0700 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2017-10-27 09:02:16 -0400 |
commit | 91b9514aafbefd5c9c10380878bef1b03245d10c (patch) | |
tree | c6e951101d304c1dfac6d29e50a2a2fe693cf7a1 /store/sqlstore/post_store.go | |
parent | 1e2506b2dfda87e65aa2f75f1e507046145cd2b8 (diff) | |
download | chat-91b9514aafbefd5c9c10380878bef1b03245d10c.tar.gz chat-91b9514aafbefd5c9c10380878bef1b03245d10c.tar.bz2 chat-91b9514aafbefd5c9c10380878bef1b03245d10c.zip |
Adding Posts table indexes for 20M rows. (#7728)
Diffstat (limited to 'store/sqlstore/post_store.go')
-rw-r--r-- | store/sqlstore/post_store.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/store/sqlstore/post_store.go b/store/sqlstore/post_store.go index d8f93d2bc..6faf51c3d 100644 --- a/store/sqlstore/post_store.go +++ b/store/sqlstore/post_store.go @@ -11,6 +11,7 @@ import ( "strings" "bytes" + l4g "github.com/alecthomas/log4go" "github.com/mattermost/mattermost-server/einterfaces" "github.com/mattermost/mattermost-server/model" @@ -73,6 +74,9 @@ func (s SqlPostStore) CreateIndexesIfNotExists() { s.CreateIndexIfNotExists("idx_posts_user_id", "Posts", "UserId") s.CreateIndexIfNotExists("idx_posts_is_pinned", "Posts", "IsPinned") + s.CreateCompositeIndexIfNotExists("idx_posts_channel_id_update_at", "Posts", []string{"ChannelId", "UpdateAt"}) + s.CreateCompositeIndexIfNotExists("idx_posts_channel_id_delete_at_create_at", "Posts", []string{"ChannelId", "DeleteAt", "CreateAt"}) + s.CreateFullTextIndexIfNotExists("idx_posts_message_txt", "Posts", "Message") s.CreateFullTextIndexIfNotExists("idx_posts_hashtags_txt", "Posts", "Hashtags") } |