perf: index dashboard job ordering - #209
Conversation
giscebot
left a comment
There was a problem hiding this comment.
Approved. The expression index matches the dashboard's canonical status-priority, recency, and deterministic ID ordering exactly, so SQLite can satisfy the unfiltered LIMIT query by walking the index instead of scanning and building a temporary B-tree. The populated query-plan regression uses the production SELECT/order expression, asserts the named index is selected, and explicitly rejects a temporary ORDER BY B-tree; the existing behavior test still covers returned ordering. I also checked that schema.sql is handled by the repository's migration-sensitive autoupdate path. GitHub CI passes on Python 3.11 and 3.12. I attempted the two focused tests locally, but this checkout has no test dependencies installed (collection stopped at missing fastapi), so I relied on the green CI runs for execution evidence.
Summary
Validation
pytest -q— 354 passedSCAN jobs | USE TEMP B-TREE FOR ORDER BYCloses #201