Skip to content

Unify index key representation in query plan#5275

Open
joshua-spacetime wants to merge 3 commits into
masterfrom
joshua/refactor/index-ops
Open

Unify index key representation in query plan#5275
joshua-spacetime wants to merge 3 commits into
masterfrom
joshua/refactor/index-ops

Conversation

@joshua-spacetime

@joshua-spacetime joshua-spacetime commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Description of Changes

Refactors index probes so that multi-column index keys are represented as a single product value expression PhysicalExpr::Product instead of being split across various fields and structs. As a result, this patch also simplifies the index-scan and index-join query executor variants now that index scans/probes share one physical shape.

This change is in preparation for adding formal parameters to query plans. Since index probe values now have single unified representation as a PhysicalExpr, a future parameterized plan can represent an index scan or index join as follows:

IndexProbe::Point(PhysicalExpr::Product(vec![
    PhysicalExpr::Param(sender_slot),
    PhysicalExpr::Value(other_const),
]))

PhysicalExpr::Product(vec![
    PhysicalExpr::Param(sender_slot),
    PhysicalExpr::Field(lhs_join_field),
])

This will avoid having to duplicate parameter handling in a bunch of different places or rules.

Note, a very nice consequence of this refactor is that it removes/consolidates a significant amount of code as the diff shows.

API and ABI breaking changes

N/A

Expected complexity level and risk

...

Testing

Existing coverage

@joshua-spacetime joshua-spacetime force-pushed the joshua/refactor/index-ops branch from a12fef7 to 736ae71 Compare June 10, 2026 20:27
@joshua-spacetime joshua-spacetime changed the title Joshua/refactor/index ops Unify index key representation in query plan Jun 10, 2026
@joshua-spacetime joshua-spacetime force-pushed the joshua/refactor/index-ops branch from 736ae71 to fa08c01 Compare June 10, 2026 20:28
@joshua-spacetime joshua-spacetime force-pushed the joshua/refactor/index-ops branch from a765440 to 28a0f79 Compare June 10, 2026 22:44
@joshua-spacetime joshua-spacetime marked this pull request as ready for review June 10, 2026 23:30
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.

1 participant