Commit Graph

1 Commits

Author SHA1 Message Date
foxtacles
364911dc9e
Index memory_completions(event_id, completed_at) for delete reconcile (#36)
Some checks failed
Build / build (push) Has been cancelled
The account-deletion reconcile in account.ts uses a correlated subquery
to pick the latest-per-event row from memory_completions. Without an
index whose leading column is event_id the inner subquery falls back to
scanning sqlite_autoindex_memory_completions_1, making the reconcile
O(rows^2) — observed cost in production was ~171k rows read for one
deletion against ~407 rows. With this covering index the inner becomes
a seek and the reconcile drops to ~rows*log(rows).
2026-05-06 01:07:02 +02:00