You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Tran Hong Quan (Jira)" <se...@james.apache.org> on 2026/03/09 03:24:00 UTC
[jira] [Created] (JAMES-4187) Drop Cassandra EmailQueryView lookup table by enriching FlagsUpdated with internalDate
Tran Hong Quan created JAMES-4187:
-------------------------------------
Summary: Drop Cassandra EmailQueryView lookup table by enriching FlagsUpdated with internalDate
Key: JAMES-4187
URL: https://issues.apache.org/jira/browse/JAMES-4187
Project: James Server
Issue Type: Improvement
Components: cassandra, JMAP
Reporter: Tran Hong Quan
Assignee: Antoine Duprat
*Goal*: Refactor EmailQueryView delete API so Cassandra delete operations use the query table primary key directly (`mailboxId` + `receivedAt`+ `messageId`), allowing removal of the`email_query_view_date_lookup` table.
h2. Why
Today, on FlagsUpdated, EmailQueryView delete can require a lookup-table path `(delete(mailboxId, messageId))`, which causes extra DB table + write/read.
Using receivedAt from the event lets us delete directly by Cassandra PK and remove the lookup table entirely.
h2. How
1. Extend `FlagsUpdated` event payload with optional internalDate (backward-compatible for rolling upgrades).
2. Refactor EmailQueryView delete API:
- from *delete(MailboxId, MessageId)*
- to *delete(MailboxId, Instant receivedAt, MessageId)*
3. Update `PopulateEmailQueryViewListener` and all delete callers to pass receivedAt.
4. Drop the Cassandra `email_query_view_date_lookup` table.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org