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
perf(api): push recommendations keyset pagination into the store read #981
Follow-up from #974 (keyset pagination for GET /api/recommendations, #723).
Problem
#974 bounds the response per page. Each page request still loads the full filtered recommendation set via ListRecommendations (ListStoredRecommendations has no ORDER BY/LIMIT/cursor), unmarshals it, and sorts it in memory just to return one page. Walking an 8,000-row tenant in 1,000-row pages therefore loads and sorts 8,000 rows eight times, and per-request memory still grows with tenant size.
Suggested fix
Push the keyset boundary (id > cursor) and LIMIT into the store read, with a deterministic ORDER BY. Compute the full-set summary and regions with a separate aggregate query, so page reads stay O(page).
Source: CodeRabbit finding on #974 (thread 4294696025), triaged as out of scope there.
Activity