Improve mark-older-as-unseen performance
This commit is contained in:
parent
0490ce394d
commit
9e99c0706a
1 changed files with 1 additions and 3 deletions
|
|
@ -1222,15 +1222,13 @@ impl EuphRequest {
|
|||
id: Snowflake,
|
||||
seen: bool,
|
||||
) -> rusqlite::Result<()> {
|
||||
// TODO Speed up this update
|
||||
// Maybe with an index on (room, id, seen) and a filter to only set seen
|
||||
// where it isn't already set correctly?
|
||||
conn.execute(
|
||||
"
|
||||
UPDATE euph_msgs
|
||||
SET seen = :seen
|
||||
WHERE room = :room
|
||||
AND id <= :id
|
||||
AND seen != :seen
|
||||
",
|
||||
named_params! { ":room": room, ":id": id, ":seen": seen },
|
||||
)?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue