Files
ARTEX/traffic
Phantom-IN efc7c09fdd perf(traffic): index exchanges on (host, ts)
traffic_search and the host-filtered traffic list run
WHERE host=? ORDER BY ts DESC LIMIT n. With only idx_ex_host(host) SQLite
reads every exchange of the host and sorts them in a temp b-tree to return
the newest few. Hosts(), which the traffic page polls every 5 s, scans the
table for GROUP BY host / MAX(ts).

Replace idx_ex_host with idx_ex_host_ts(host, ts). The host search walks
the index backwards and stops after n rows, and Hosts() reads only the
index. Existing stores get the new index and drop the old one on open.

BenchmarkHostSearch, 50k exchanges (45k on one host):
  search  42.05 ms -> 0.038 ms
  hosts   19.89 ms -> 7.77 ms
2026-11-25 20:53:55 +05:30
..