Skip to content

Physical planning is slow for wide struct columns because null struct scalars allocate every child #27557

Open

Description

@asubiotto

Is your feature request related to a problem or challenge?

Planning builds an unbounded range for every column an expression refers to, through Interval::make_unbounded → ScalarValue::try_new_null. For a struct, this allocates a null child array for every field. Optimizer passes rebuild projections and filters many times, so the work repeats. In our workload, a query over three structs of about 5,000 fields each spends hundreds of milliseconds in physical planning on this.

#26879 reuses a column's range within one projection, but not across rebuilds.

Describe the solution you'd like

A null struct row never reads its children, so children of equal type can share one null array. The result is equal to what new_null_array builds, but takes a few allocations instead of one per field.

Describe alternatives you've considered

Additional context

Related: #26065 (slow comparison of null struct scalars).

AI disclosure: written with the help of Claude Code and reviewed by me.

Willingness to contribute

I plan to contribute to this feature independently

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      Sponsor
      SponsoredKunjungi sekarang
      Promo