Skip to content

refactor(email): Inbox and All Mail thread previews#1083

Merged
evanhutnik merged 4 commits intomainfrom
evan/query-optimizations
Jan 21, 2026
Merged

refactor(email): Inbox and All Mail thread previews#1083
evanhutnik merged 4 commits intomainfrom
evan/query-optimizations

Conversation

@evanhutnik
Copy link
Copy Markdown
Contributor

@evanhutnik evanhutnik commented Jan 20, 2026

Optimizing the Inbox and All Mail email thread preview queries. Since we do a lateral join on the result, getting the id of the labels queried once at the start saves it from having to grab it for each row. Also adding an index for fetching the latest non-draft of each thread. This speeds up Inbox by roughly 40% and All Mail by 20% in my testing.

Also, updating Inbox and All Mail query views to include macro drafts.

@claude
Copy link
Copy Markdown
Contributor

claude bot commented Jan 20, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@evanhutnik evanhutnik changed the title refactor(email): Improve thread preview query performance refactor(email): Inbox and All Mail thread previews Jan 20, 2026
@evanhutnik evanhutnik merged commit 366bfdd into main Jan 21, 2026
38 checks passed
@evanhutnik evanhutnik deleted the evan/query-optimizations branch January 21, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants