Skip to content

Commit 065a433

Browse files
perf(server): pin the index for the unscoped agent event high-water (#29623)
Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent 60aec28 commit 065a433

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎apps/server/src/persistence/OrchestrationEventStore.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,8 @@ const makeEventStore = Effect.gen(function* () {
645645
FROM orchestration_events
646646
${
647647
threadId === undefined
648-
? sql``
648+
? // The planner can otherwise pick the covering stream index and scan every agent event.
649+
sql`INDEXED BY idx_orchestration_events_application_sequence`
649650
: sql`INDEXED BY idx_orchestration_events_agent_stream_sequence`
650651
}
651652
WHERE application_event_version = 2

0 commit comments

Comments
 (0)