Read message archives in batches #170

Merged
jcoffey-dev merged 1 commits from perf/batched-reads into main 2026-10-08 19:15:07 +00:00
1 Commits
Author SHA1 Message Date
jcoffey-dev f80fe8b873 Read message archives in batches
ci / fork-checks (pull_request) Skipped
ci / build (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 9m26s
Store::get_values reads a set of keys in one round trip on PostgreSQL
(k = ANY($1)) and falls back to one get_value per key elsewhere. A
replicated store serves the batch from a replica and re-reads from the
primary the keys the replica has not received yet.

IMAP FETCH and STORE, JMAP Email/get and the message and mailbox cache
refreshers that every node runs after a write now read their archives
READ_BATCH_SIZE (128) at a time instead of one round trip per message.
FETCH also prefetches the message data of the messages it is about to
mark \Seen, saving the second round trip per message.
2026-10-08 10:59:13 -07:00