core: create indices on chat_items for faster pagination (#927)

This commit is contained in:
JRoberts
2022-08-11 15:48:47 +04:00
committed by GitHub
parent 622ab549a3
commit cc498572cd
4 changed files with 28 additions and 1 deletions
@@ -382,3 +382,14 @@ CREATE TABLE calls(
created_at TEXT NOT NULL DEFAULT(datetime('now')),
updated_at TEXT NOT NULL DEFAULT(datetime('now'))
);
CREATE INDEX idx_chat_items_groups ON chat_items(
user_id,
group_id,
item_ts,
chat_item_id
);
CREATE INDEX idx_chat_items_contacts ON chat_items(
user_id,
contact_id,
chat_item_id
);