From 467f46b1903649efa9b6197afadfeffd32627f07 Mon Sep 17 00:00:00 2001 From: can1357 Date: Tue, 30 Jun 2026 07:01:32 +0200 Subject: [PATCH] perf(scripts/session-stats): added composite index on tool call timestamp and name - Added a composite index `ss_tc_ts_tool` on the `timestamp` and `tool_name` columns of the `ss_tool_calls` table to optimize query performance. --- scripts/session-stats/sync.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/session-stats/sync.py b/scripts/session-stats/sync.py index 026373ec8..d50132939 100644 --- a/scripts/session-stats/sync.py +++ b/scripts/session-stats/sync.py @@ -96,6 +96,7 @@ CREATE TABLE IF NOT EXISTS ss_tool_calls ( UNIQUE(session_file, call_id, seq) ); CREATE INDEX IF NOT EXISTS ss_tc_tool_ts ON ss_tool_calls(tool_name, timestamp); +CREATE INDEX IF NOT EXISTS ss_tc_ts_tool ON ss_tool_calls(timestamp, tool_name); CREATE INDEX IF NOT EXISTS ss_tc_sess_seq ON ss_tool_calls(session_file, seq); CREATE TABLE IF NOT EXISTS ss_tool_results (