You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ui-server: deleting unused journal objects scans every checkout receipt #4445
Part of #4426 (follow-ups from #4278). Deferred from the combined review of PR #4444; the code came from #4362.
Context
turn_journal_code_receipts.pack_hash references turn_journal_objects(hash) with no child index (packages/ui-server/migrations/096_code_change_receipts.journal.sql:6). collect deletes objects one by one (packages/ui-server/src/brain/journal-store.ts:124-131) during finish, while workers are held. Each delete's foreign-key check therefore scans the receipts table. The reviewer measured 243 ms against 2.8 ms for 2,000 deletes at 5,000 receipts.
Scope
Add an index on pack_hash, admitted within quota like the other derived journal indexes. No change to receipt semantics.
Acceptance criteria
EXPLAIN QUERY PLAN for the object delete's foreign-key check uses an index, not SCAN turn_journal_code_receipts.
A near-cap store keeps accepting writes when the index cannot be admitted.
Activity