nextcloud / nextcloud/mail

Reduce IMAP message ID index prefix lengths

Open
#12,862 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop enhancement
Dominant language
JavaScript
Stars
1k
Forks
348
Avg merge
12h 28m
Merged PRs (30d)
91

Description

Is your feature request related to a problem? Please describe.

There are three indices on IMAP message IDs. The original data can be 1023B long.

  • mail_messages_msgid_idx is 128B
  • mail_msg_thrd_root_snt_idx is 64B
  • mail_msg_imap_id_idx is 128B
Describe the solution you'd like

Shorten the prefixes to 64B consistently.

Describe alternatives you've considered

Store hashes only, use 32B. Use the hashes for all lookups. Caveat: our operation shave to support that. This is something to do research on.

Additional context

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the three named indices—mail_messages_msgid_idx, mail_msg_thrd_root_snt_idx, and mail_msg_imap_id_idx—and then inspect pull request 12633 for the relevant implementation context. Confirm how the indices are defined and how IMAP message IDs are looked up; done means all three use 64B prefixes without breaking those lookups.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
database
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.