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
fix(storage): session profile backfill UPDATEs run on every connection bootstrap #487
schema_bootstrap.py:373-396 — three SchemaBackfillDescriptor instances run on every connection initialization when the schema is current-version:
UPDATE session_profiles SET evidence_search_text = search_text
WHERETRIM(COALESCE(evidence_search_text, '')) =''
Same for inference_search_text and enrichment_search_text.
These are gated by TRIM(COALESCE(X, '')) = '' so they're idempotent — but they still scan every row of session_profiles on every schema check. For large archives with millions of sessions, this adds measurable startup latency.
Fix
Track backfill completion in PRAGMA user_version metadata or a dedicated status table, and skip backfills that have already completed. Or add a partial index on the gating condition so the scan becomes an index lookup.
Activity
perf(storage): scope session-profile backfill UPDATEs to partial inde…
perf(storage): scope session-profile backfill UPDATEs to partial inde…