Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Conversation listing scans general workspace message history to aggregate DMs, then issues one preview and one unread query per returned pair. Under production load this endpoint reached roughly 21-second p95 before the preceding membership fix and remained the slowest read afterward.
Add a partial covering index on
(network_id, source, target, timestamp DESC, id DESC) INCLUDE (visibility)forvisibility = 'direct' AND type = 'workspace.message.posted'. Aggregate exact lifetime counts from direct-message index entries, and batch preview and unread queries so up to 100 conversations use at most three event queries instead of up to 201. Latest-event timestamp ties now resolve deterministically by descending ID. Preserve identity filtering before the limit, legacy unlinked DMs, stored read markers, unread cutoffs, preferences and workspace isolation.Validation:
Production rollout requires the user's explicit schema-change approval under workspace/AGENTS.md. Do not promote this draft yet. Migration 086 creates the additive index CONCURRENTLY with a five-second lock timeout and verifies index validity. Existing application versions remain compatible; no messages or columns are rewritten. The normal deployment coordinator takes and verifies a database backup before migration, then rolls the two backend nodes. Index construction still reads the events table and consumes I/O/CPU; it may temporarily increase latency. Production statistics currently estimate 13.2 million events, a 5.3 GB heap, and 1.8% direct traffic. Actual build duration/size are not yet measured.
After approval: promote the tested merge through promote-release.yml, verify index validity and the production query plan, then compare authenticated probes and request timing samples after rollout. On failure, leave the old application serving; inspect any invalid index and retry only after cleanup. Application rollback can leave the additive index in place; removing it uses DROP INDEX CONCURRENTLY after approval.