Avoid full post scans in timeline queries - #634
Merged
dahlia merged 1 commit intoOct 1, 2026
Merged
Conversation
Use correlated NOT EXISTS checks for shared-post authors instead of collecting every muted or blocked author's post ID. Reuse these checks across home, public, and list timelines while preserving expired mute and bidirectional block behavior. Add regression tests for ordinary posts and shares, both cursor directions, and both timeline inbox modes. Document the fix in the changelog. Fixes fedify-dev#633 Assisted-by: Codex:gpt-6.1-sol Assisted-by: Claude Code:claude-opus-5-5
Member
Author
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
Member
Author
|
@coderabbitai full review |
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.
Shared-post filters could scan the entire
poststable to collect IDs from muted or blocked authors. CorrelatedNOT EXISTSchecks now look up each candidate's shared post by primary key. Home, public, and list timelines share these checks, which still respect mute expiry and blocks in either direction.Verified with 21 timeline tests covering both inbox modes, plus type, lint, and format checks. In a simplified probe with 1.5 million rows on PostgreSQL 17.11, execution time for one mute filter fell from 207 ms to 0.24 ms.
Fixes #633.