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 "Benoit Tellier (Jira)" <se...@james.apache.org> on 2026/03/13 21:33:00 UTC

[jira] [Closed] (JAMES-4187) Drop Cassandra EmailQueryView lookup table by enriching FlagsUpdated with internalDate

     [ https://issues.apache.org/jira/browse/JAMES-4187?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benoit Tellier closed JAMES-4187.
---------------------------------
    Resolution: Fixed

This work is merged

> 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
>            Priority: Minor
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> *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