mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
Add a "Total/blocked network calls" column to the AIBridge sessions table. Update `ListAIBridgeSessions` query to calculate network called made and blocked per session. See query plan [here](https://explain.dalibo.com/plan/54355c90b165ggb4). --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
16 lines
794 B
SQL
16 lines
794 B
SQL
-- Replace the session-only index with a composite index on
|
|
-- (agent_firewall_session_id, agent_firewall_sequence_number). The sessions
|
|
-- list computes each interception's next firewall sequence number to bound the
|
|
-- boundary_logs it triggered; the composite index serves that lookup index-only
|
|
-- and still covers session-only lookups.
|
|
DROP INDEX IF EXISTS idx_aibridge_interceptions_agent_firewall_session_id;
|
|
|
|
CREATE INDEX idx_aibridge_interceptions_agent_firewall_session_seq
|
|
ON aibridge_interceptions (agent_firewall_session_id, agent_firewall_sequence_number)
|
|
WHERE agent_firewall_session_id IS NOT NULL;
|
|
|
|
DROP INDEX IF EXISTS idx_boundary_logs_session_seq;
|
|
|
|
CREATE INDEX idx_boundary_logs_session_seq
|
|
ON boundary_logs (session_id, sequence_number) INCLUDE (matched_rule);
|