Skip to content

refactor: Remove history_mode from ExecutionContext - #1212

Merged
bplatz merged 2 commits into
mainfrom
refactor/history-query
May 1, 2026
Merged

bplatz merged 2 commits into
mainfrom
refactor/history-query

Conversation

@bplatz

@bplatz bplatz commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

This PR follows up on the history-query planning feedback by removing history_mode from ExecutionContext and making temporal mode a planner-time concern. History-vs-current semantics are now decided before operator construction via PrepareConfig/PlanningContext, so the planner builds the appropriate operator tree once instead of asking runtime operators to branch on a context flag.

For history queries, scan construction now selects the dedicated history scan path up front, while current-state queries continue to use the normal binary scan operator. Fast paths that only have current-state semantics are gated during planning, so they are not constructed for history-range queries. Late-built subplans such as OPTIONAL, UNION, FILTER EXISTS, MINUS, and related operators capture the same planning context to avoid silently falling back to current-state behavior.

The refactor keeps RangeOptions::history_mode/QueryBounds::history_mode in the core range API, where they remain the lower-level instruction for range_with_overlay. The user-facing query execution path no longer carries a runtime history flag through ExecutionContext; prepared execution now captures temporal semantics in the planned operator tree.

Test coverage was expanded with history combination cases for OPTIONAL, UNION, FILTER NOT EXISTS, and count fast-path avoidance. These tests specifically guard against the old failure mode where nested or late-built subplans could accidentally plan as current-state and miss retract events.

@bplatz
bplatz requested review from aaj3f and zonotope April 30, 2026 21:34

@zonotope zonotope left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎒

@bplatz
bplatz merged commit e60a597 into main May 1, 2026
12 checks passed
@bplatz
bplatz deleted the refactor/history-query branch May 1, 2026 17:00
@bplatz bplatz mentioned this pull request May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants