PRATHAMESH75
034eadb326
perf(state): index assistant tool-call rows for Insights queries
...
InsightsEngine._get_tool_usage and _get_skill_usage scan messages for
role='assistant' AND tool_calls IS NOT NULL, but no index aligns with
that predicate, so SQLite scans the full messages table on a large
state.db. Add a partial index over exactly those rows.
role and tool_calls are base columns in the messages table, so the index
lives in SCHEMA_SQL (created on both fresh and existing databases via the
executescript on every open) rather than DEFERRED_INDEX_SQL.
Adds schema regression coverage (fresh + reopened DB, plan uses the index)
and an Insights regression test proving tool/skill output is identical with
and without the index present.
Fixes #67341
2026-08-03 17:32:13 +05:30
..
2026-08-02 20:21:59 -07:00
2026-08-01 13:27:58 +05:30
2026-08-03 17:32:13 +05:30
2026-08-01 14:59:14 -07:00
2026-08-02 20:30:06 -07:00
2026-07-29 14:12:25 -07:00
2026-07-29 13:39:40 -07:00
2026-08-03 17:18:51 +05:30
2026-07-29 13:39:40 -07:00
2026-08-01 10:52:34 -07:00
2026-07-29 12:19:37 -07:00
2026-08-03 17:31:29 +05:30
2026-08-03 17:18:31 +05:30
2026-07-29 13:39:40 -07:00
2026-07-29 18:55:10 -07:00
2026-07-29 13:39:40 -07:00
2026-07-29 13:10:23 -07:00
2026-08-02 15:10:15 -07:00
2026-08-03 17:16:34 +05:30
2026-08-03 17:15:12 +05:30
2026-07-31 22:33:11 -07:00
2026-08-02 00:11:50 -07:00
2026-08-02 16:18:28 -07:00
2026-07-31 23:18:12 -07:00
2026-08-03 14:30:05 +05:30
2026-08-03 09:59:58 +05:30
2026-07-31 22:33:11 -07:00
2026-07-29 21:30:53 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-01 15:05:05 +05:30
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-02 00:11:50 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 15:12:28 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-01 23:28:28 -05:00
2026-07-29 13:10:23 -07:00
2026-08-02 00:11:50 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-01 22:56:52 -05:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-31 22:35:07 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 18:13:09 -07:00
2026-08-03 17:32:13 +05:30
2026-07-29 18:55:10 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 17:35:16 -05:00
2026-07-31 22:39:11 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 18:13:09 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 21:30:53 -07:00
2026-07-29 19:53:17 -07:00
2026-08-01 21:17:51 -04:00
2026-08-01 13:13:30 +05:30
2026-07-30 00:08:28 -05:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 15:12:28 -07:00
2026-07-29 13:10:23 -07:00
2026-07-31 22:35:16 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 19:48:37 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 21:30:53 -07:00
2026-07-29 21:30:53 -07:00
2026-07-29 13:10:23 -07:00
2026-08-02 10:04:48 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-02 21:32:13 +05:30
2026-07-31 23:18:12 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-01 15:58:42 +05:30
2026-08-03 13:45:08 +05:30
2026-07-29 13:10:23 -07:00
2026-08-02 21:30:54 +05:30
2026-08-02 23:10:28 +05:30
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00