Skip to content

perf(post-content): bound the ordered backfill scan - #785

Merged
seonghobae merged 2 commits into
feat/orchestrator-routing-endpoint-consumerfrom
perf/post-content-backfill-candidate-index-20260828
Aug 28, 2026
Merged

perf(post-content): bound the ordered backfill scan#785
seonghobae merged 2 commits into
feat/orchestrator-routing-endpoint-consumerfrom
perf/post-content-backfill-candidate-index-20260828

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • preserve post-content candidate semantics while expressing one-to-zero/one checks as correlated existence predicates
  • add a replay-safe partial expression index matching the governed event-time ordering
  • document the bounded scan contract in ADR 0098

Canonical PostgreSQL 16 evidence

  • feat(orchestrator): scope endpoint routing selector #781 query before: 2526.445 ms, 462185 shared hits, 17666 reads, 486 temp reads, 3867 temp writes, 30 MB external merge
  • transactional index-only attempt still sorted all candidates: 1508.137 ms with temp I/O
  • SQL rewrite plus transaction-local index: 389.627 ms, 97544 shared hits, 3805 reads, no temp I/O
  • the temporary proof index was rolled back and confirmed absent; canonical source rows and volumes were not changed
  • both producer modes returned the same ordered candidate rows as feat(orchestrator): scope endpoint routing selector #781 (200/200 for ordinary backfill; 0/0 for case-analysis admission)

Verification

  • uv run --extra dev --extra backend pytest -q tests/test_post_content_queue.py tests/test_queue_post_content_backfill_script.py tests/test_post_content_backfill_endpoint.py tests/test_post_content_backfill_schema.py tests/test_migration_replay.py (59 passed)
  • git diff --check HEAD^ HEAD

Devin Review

Signed-off-by: Codex <codex@localhost>
@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 63cfde66-1752-4ebe-9103-0b9101d8c9f3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

devin-ai-integration[bot]

This comment was marked as resolved.

Keep the parent stack public-claim envelope at 0257 and assign the independently stacked backfill candidate index to 0258.

Signed-off-by: Codex <codex@localhost>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

Devin Review

Comment thread migrations/0258_post_content_backfill_candidate_index.sql
@seonghobae
seonghobae merged commit bcd7b8e into feat/orchestrator-routing-endpoint-consumer Aug 28, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant