Index usage(session_id): the Factory overview scanned the usage table 900 times per request

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Richard ZinkandClaude Sonnet 5.5 committed 2026-11-21 22:51:06 +01:00
1 parent 9addac8c91
commit abdf7d3925
3 files changed
+11

No files matched your search

+1
View File
@@ -51,6 +51,7 @@ impl Store {
);
CREATE INDEX IF NOT EXISTS usage_ts ON usage(ts);
CREATE INDEX IF NOT EXISTS usage_root ON usage(root_session_id);
CREATE INDEX IF NOT EXISTS usage_session ON usage(session_id);
CREATE TABLE IF NOT EXISTS users (
id TEXT PRIMARY KEY,
username TEXT NOT NULL UNIQUE COLLATE NOCASE,