Skip to content

Avoid full post scans in timeline queries - #634

Merged
dahlia merged 1 commit into
fedify-dev:0.9-maintenancefrom
dahlia:bugfix/slow-home-timeline
Oct 1, 2026
Merged

dahlia merged 1 commit into
fedify-dev:0.9-maintenancefrom
dahlia:bugfix/slow-home-timeline

Conversation

@dahlia

@dahlia dahlia commented Oct 1, 2026

Copy link
Copy Markdown
Member

Shared-post filters could scan the entire posts table to collect IDs from muted or blocked authors. Correlated NOT EXISTS checks 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.

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
@dahlia dahlia self-assigned this Oct 1, 2026
@dahlia dahlia added the bug Something isn't working label Oct 1, 2026
@dahlia

dahlia commented Oct 1, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@dahlia

dahlia commented Oct 1, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@dahlia
dahlia requested a balanced review from Copilot October 1, 2026 07:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@dahlia
dahlia merged commit 0d0c025 into fedify-dev:0.9-maintenance Oct 1, 2026
2 checks passed
@dahlia dahlia linked an issue Oct 1, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Home timeline query is slow (scans the entire posts table)

2 participants