Skip to content

Store plan children in fixed-position slots - #11178

Merged
joseph-isaacs merged 4 commits into
developfrom
ji/loving-bohr-tw0ypy
Nov 4, 2026
Merged

joseph-isaacs merged 4 commits into
developfrom
ji/loving-bohr-tw0ypy

Conversation

@joseph-isaacs

@joseph-isaacs joseph-isaacs commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Physical plan children used to be a packed list (PlanChildren). An absent child, such as the validity of a non-nullable struct, shifted the positions of the children after it, so lowering had to remap layout slots to plan indices for each layout kind.

Plans now store children in fixed-position slots, the same way arrays and layouts already do. An absent child is a None slot, so a child's position never depends on which other children are present.

Changes

Slots replace children (slots.rs, replacing children.rs)

  • PlanSlots is a SmallVec<[Option<LazyPlanRef>; 4]> newtype.
  • LazyPlanRef is one Arc holding a OnceCell<PlanRef> and an unsized Fn initializer.
    • It replaces the single list-level initializer: each slot is built on first access, independently of the others.
    • Clones share the built plan, so with_slots and Concat::map_chunks never lower a child twice.
    • A failed build leaves the slot unbuilt, and the next access retries it.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/performance A performance improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants