Close the plan: screenshots and a measured performance pass

- docs/screenshots: nineteen pages captured with headless Chromium from a
  running instance; README gains a screenshot section
- tests/perf: opt-in load test (NOEMA_PERF=1) seeding 60k events, 6k
  memories and 1.5k beliefs across two minds, timing sixteen hot reads
  against a 400 ms ceiling and rejecting sequential-scan plans
- migration 0016: indexes the test found missing (memories by mind and
  recency, beliefs by mind and confidence, events by mind and category,
  belief versions by mind and time)
- docs/performance.md records the numbers and how to rerun
This commit is contained in:
Andy Dixon
2026-07-06 23:18:31 +01:00
parent 89580c0a79
commit d9ae91e406
25 changed files with 264 additions and 2 deletions
@@ -0,0 +1,4 @@
DROP INDEX IF EXISTS belief_versions_mind_created_idx;
DROP INDEX IF EXISTS cognitive_events_mind_category_seq_idx;
DROP INDEX IF EXISTS beliefs_mind_confidence_idx;
DROP INDEX IF EXISTS memories_mind_recent_idx;
+7
View File
@@ -0,0 +1,7 @@
-- Performance pass (Phase 16): indexes matching the hot list orders found by
-- tests/perf. The planner chose sequential scans because the existing
-- (mind_id, kind|status) indexes could not serve the ORDER BY.
CREATE INDEX IF NOT EXISTS memories_mind_recent_idx ON memories (mind_id, occurred_at DESC, id DESC) WHERE status = 'active';
CREATE INDEX IF NOT EXISTS beliefs_mind_confidence_idx ON beliefs (mind_id, confidence DESC) WHERE status <> 'superseded';
CREATE INDEX IF NOT EXISTS cognitive_events_mind_category_seq_idx ON cognitive_events (mind_id, category, seq);
CREATE INDEX IF NOT EXISTS belief_versions_mind_created_idx ON belief_versions (mind_id, created_at DESC);