-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #667 from stakwork/aa/feature/db-message-index
Add index on messageDbo and chatDbo tables
- Loading branch information
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
sphinx/application/data/concepts/concept-coredb/src/main/sqldelight/migrations/19.sqm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
CREATE INDEX idx_message_chat_type_status ON messageDbo(chat_id, type, status); | ||
CREATE INDEX idx_message_chat_type_reply_thread ON messageDbo(chat_id, type, reply_uuid, thread_uuid); | ||
CREATE INDEX idx_message_uuid ON messageDbo(uuid); | ||
CREATE INDEX idx_message_chat_date ON messageDbo(chat_id, date DESC); | ||
CREATE INDEX idx_message_sender_chat_type ON messageDbo(sender, chat_id, type); | ||
CREATE INDEX idx_message_id ON messageDbo(id); | ||
CREATE INDEX idx_message_muid_original_muid ON messageDbo(muid, original_muid); | ||
|
||
CREATE INDEX idx_chat_id ON chatDbo(id); | ||
CREATE INDEX idx_chat_type ON chatDbo(type); | ||
CREATE INDEX idx_chat_latest_message_id ON chatDbo(latest_message_id); | ||
CREATE INDEX idx_chat_name ON chatDbo(name); |