Repository navigation
refactor: Remove history_mode from ExecutionContext - #1212
Merged
Merged
Conversation
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR follows up on the history-query planning feedback by removing
history_modefromExecutionContextand making temporal mode a planner-time concern. History-vs-current semantics are now decided before operator construction viaPrepareConfig/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_modein the core range API, where they remain the lower-level instruction forrange_with_overlay. The user-facing query execution path no longer carries a runtime history flag throughExecutionContext; 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.