Skip to content

fix: recreate imap_markseen with PRIMARY KEY constraint#8360

Open
link2xt wants to merge 1 commit into
mainfrom
link2xt/zstplwvsulpz
Open

fix: recreate imap_markseen with PRIMARY KEY constraint#8360
link2xt wants to merge 1 commit into
mainfrom
link2xt/zstplwvsulpz

Conversation

@link2xt

@link2xt link2xt commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

It is needed to speed up "DELETE FROM imap_markseen_new WHERE id = ?". Otherwise if imap_markseen table grows large,
marking a lot of messages at once as seen and trying to delete them one by one from imap_markseen table may have quadratic complexity.

@link2xt

link2xt commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator Author

It is not clear if this change fixes #8311, but I think it makes sense to do it in any case as it turns SCAN query plan into SEARCH and turns second id column into rowid. Then can be tested again if the problem is solved.

@link2xt link2xt marked this pull request as ready for review June 22, 2026 22:27
It is needed to speed up "DELETE FROM imap_markseen_new WHERE id = ?".
Otherwise if imap_markseen table grows large,
marking a lot of messages at once as seen and trying to delete them one by one
from imap_markseen table may have quadratic complexity.
@link2xt link2xt force-pushed the link2xt/zstplwvsulpz branch from 42751b8 to 6821e25 Compare June 23, 2026 02:14
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

Successfully merging this pull request may close these issues.

2 participants