|
core: session lists read aggregates, search matches from SQL
GET /sessions without paging hydrated every hot message of every listed session just to return a count and a preview: 313 ms locally, and the whole hot history allocated. `list_all_summaries` returns the same rows in the same order with the count and snippet from one aggregate — 30 ms. `search_list` now returns summaries like `list_page`; "where does the term appear" comes from `search_matches`, one aggregate that reproduces the display indices clients scroll to (verified equal to the old Python scan on 105 sessions). The API search path drops from ~500 ms to ~150 ms, most of which is the ILIKE scan itself — see docs/sessions.md for the pg_trgm note. The stale-session sweep on POST /sessions takes its candidates from summaries and loads a history only for a session that actually needs extraction. |
|---|
|
|
| docs/sessions.md |
|---|
| navi/api/routes/admin/sessions.py |
|---|
| navi/api/routes/admin/users.py |
|---|
| navi/api/routes/sessions/listing.py |
|---|
| navi/core/session.py |
|---|
| navi/core/sessions/rows.py |
|---|
| navi/core/sessions/store.py |
|---|
| tests/unit/core/test_session_list_summaries.py 0 → 100644 |
|---|