Repository navigation
perf(background_tasks): project task reads, separate exact count, index the default order - #833
Merged
Merged
Conversation
…ex the default order Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
…per, dedupe tests Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Deploying simple-module-python with
|
| Latest commit: |
5500185
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ba8fda04.simple-module-python.pages.dev |
| Branch Preview URL: | https://fix-s11-perf-background-task.simple-module-python.pages.dev |
…nd-tasks # Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
# Conflicts: # docs/database/migrations.md # host/tests/test_migration_graph.py
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.
Performance fix for the background-task status poll and the admin task list (local performance review, 2026-11-05).
dto_columns:load_only+raiseload). Status reads keepowner_user_id,tenant_id,resource_typeandresource_idfor authorization, and the list keeps the retry arguments. Largeresult/tracebackJSON is no longer fetched or decoded.count(*)plus a projected page query instead ofcount() OVER ()over wide rows. Stale-page clamping is unchanged, now throughsimple_module_db.pagination.total_pages.ix_background_tasks_task_execution_queued_orderon(queued_at IS NULL), queued_at DESC(migrationc5d8e2f1a903).newest_first()defines that ordering once for the index, the list and the status lookup. The status lookup previously sorted NULLqueued_atfirst on Postgres and last on SQLite.LIMIT 1probe (has_any()) instead of a counted list call.Measured with 100k executions on SQLite (method in
docs/perf/2026-11-05-background-task-reads.md):Pipeline: /optimize (1 commit), two review passes with triage kept locally.
Local CI:
make lint✓ ·make test-py(8 workers) 7861 passed ✓ ·make test-js✓ ·make migrations-roundtrip-pg✓ (fresh database).Note:
c5d8e2f1a903and #832'se805a1b2c3d4both revisee731a1b2c3d4; whichever merges second re-points itsdown_revision.https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4