mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-04-27 19:26:12 +00:00
core: get group history faster (#5562)
* core: get group history faster * revert join, add index (fix test) * fix postgres compilation * fix postgres schema
This commit is contained in:
@@ -425,7 +425,8 @@ CREATE TABLE chat_items(
|
||||
fwd_from_group_id BIGINT REFERENCES groups ON DELETE SET NULL,
|
||||
fwd_from_chat_item_id BIGINT REFERENCES chat_items ON DELETE SET NULL,
|
||||
via_proxy SMALLINT,
|
||||
msg_content_tag TEXT
|
||||
msg_content_tag TEXT,
|
||||
include_in_history SMALLINT NOT NULL DEFAULT 0
|
||||
);
|
||||
ALTER TABLE groups
|
||||
ADD CONSTRAINT fk_groups_chat_items
|
||||
@@ -1012,4 +1013,16 @@ CREATE INDEX idx_chat_items_groups_msg_content_tag_deleted ON chat_items(
|
||||
item_deleted,
|
||||
item_sent
|
||||
);
|
||||
CREATE INDEX idx_chat_items_groups_history ON chat_items(
|
||||
user_id,
|
||||
group_id,
|
||||
include_in_history,
|
||||
item_deleted,
|
||||
item_ts,
|
||||
chat_item_id
|
||||
);
|
||||
CREATE INDEX idx_group_snd_item_statuses_chat_item_id_group_member_id ON group_snd_item_statuses(
|
||||
chat_item_id,
|
||||
group_member_id
|
||||
);
|
||||
|]
|
||||
|
||||
Reference in New Issue
Block a user