Skip to content

Commit 564c7f5

Browse files
committed
feat: Add a db index for reactions by msg_id (#5507)
This should speed up `get_msg_reactions()` filtering reactions by `msg_id`, but also queries in other places involving both `msg_id` and `contact_id`.
1 parent 69842c1 commit 564c7f5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/sql/migrations.rs

+5
Original file line numberDiff line numberDiff line change
@@ -932,6 +932,11 @@ CREATE INDEX msgs_status_updates_index2 ON msgs_status_updates (uid);
932932
.await?;
933933
}
934934

935+
if dbversion < 114 {
936+
sql.execute_migration("CREATE INDEX reactions_index1 ON reactions (msg_id)", 114)
937+
.await?;
938+
}
939+
935940
let new_version = sql
936941
.get_raw_config_int(VERSION_CFG)
937942
.await?

0 commit comments

Comments
 (0)