Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ANNOTATE: Optimize mass-delete of a message annotation #5153

Open
alecpl opened this issue Nov 29, 2024 · 0 comments
Open

ANNOTATE: Optimize mass-delete of a message annotation #5153

alecpl opened this issue Nov 29, 2024 · 0 comments

Comments

@alecpl
Copy link
Contributor

alecpl commented Nov 29, 2024

Let's say I have a mailbox with some messages that have a /comment annotation. I don't really know which ones. For "Remove all comments from messages" action I'd just do:

a26 STORE 1:* ANNOTATION (/comment (value.priv NIL))
* 1 FETCH (FLAGS () MODSEQ (187))
* 2 FETCH (FLAGS () MODSEQ (188))
* 3 FETCH (FLAGS () MODSEQ (189))
* 4 FETCH (FLAGS () MODSEQ (190))
a26 OK Completed

There's one problem I see here. It will "modify" all messages including these that do not have the annotation.

This becomes problematic when you fetch the last changes.

a27 FETCH 1:* (ANNOTATION (/comment value.priv)) (CHANGEDSINCE 186)
* 1 FETCH (MODSEQ (187) ANNOTATION (/comment (value.priv NIL)))
* 2 FETCH (MODSEQ (188) ANNOTATION (/comment (value.priv NIL)))
* 3 FETCH (MODSEQ (189) ANNOTATION (/comment (value.priv NIL)))
* 4 FETCH (MODSEQ (190) ANNOTATION (/comment (value.priv NIL)))
a27 OK Completed (0.000 sec)

If the mailbox has a lot of messages both can be unnecessarily slow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant