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`.
This commit is contained in:
iequidoo
2024-05-31 16:31:19 -03:00
committed by iequidoo
parent 69842c18f7
commit 768ef772bb

View File

@@ -932,6 +932,11 @@ CREATE INDEX msgs_status_updates_index2 ON msgs_status_updates (uid);
.await?;
}
if dbversion < 114 {
sql.execute_migration("CREATE INDEX reactions_index1 ON reactions (msg_id)", 114)
.await?;
}
let new_version = sql
.get_raw_config_int(VERSION_CFG)
.await?