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
Session list and history queries do full table scans #30609
The global session list orders by time_updated (it runs on every TUI startup and every time the session-list dialog opens), but the session table has no index on time_updated, so the ORDER BY time_updated DESC LIMIT N query does a full table scan that gets slower as sessions accumulate.
An earlier version of this report also covered the event-history query on event(aggregate_id, seq), but that index already exists upstream, so this is now scoped to the session list.
I have a fix that adds the index with a migration.
Plugins
None
OpenCode version
1.15.13
Steps to reproduce
Open the session-list dialog (or start the TUI) with a large number of sessions; the global list runs ORDER BY time_updated DESC with no supporting index.
Run EXPLAIN QUERY PLAN on it; it reports a full table scan of session.
Activity
literally-dan commentedon Jun 3, 2026
Closing this, I opened it before it was ready for review. I'll reopen once I've gone over it properly.
github-actions commentedon Aug 9, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.