Skip to content

[EPIC] Optimize Range Partitioning for Joins and Distributed Pipelines #25421

Description

@stuhood

Background and Motivation

Range partitioning landed in DataFusion 55 (#22395), establishing the core representation, physical planning, and execution primitives for range-partitioned data. With the foundation in place, the next step is continuing to optimize planner decisions and core execution nodes—particularly around joins, distribution enforcement, partition scaling, and runtime execution primitives like dynamic filters.

As Range partitioning is integrated into distributed execution engines and multi-partition queries (such as datafusion-contrib/datafusion-distributed#730), several opportunities have emerged to preserve partition alignment, eliminate unnecessary shuffles and broadcasts, support flexible partition scaling across stages, and streamline runtime dynamic filtering across partitioned operators.

Scenarios to Optimize

  • Symmetric pre-partitioned joins
    • When two relations are already range-partitioned on join keys with matching or compatible split points (e.g. finer or coarser partition granularities), executing task-local joins with zero network shuffle and zero broadcast overhead, and targeting dynamic filter bounds directly to matching partitions.
  • Asymmetric stream adaptation
    • When joining a range-partitioned relation against an unpartitioned stream, adapting the unpartitioned stream to match the reference layout while ensuring large tables are not shuffled to match smaller dimension tables.
  • Concurrency mismatch and partition scaling
    • When target worker concurrency differs from the number of declared physical split points (under-parallelism or over-parallelism), scaling partition counts via sample down-sampling and identifying range layout relationships to group adjacent partitions or route sparse channels without full all-to-all repartitions.
  • Multi-way and hybrid pipelines
    • Preserving range metadata through multi-way join chains and hybrid pipelines where broadcast dimension joins coexist with range-partitioned streams.

Focus Areas and Priorities

High Priority: Core Optimizer Decisions, Execution Primitives, and Benchmarks

Because all consumers rely on the optimizer and core execution nodes (HashJoinExec, DynamicFilterPhysicalExpr), improving planner decisions in datafusion/physical-optimizer and execution primitives in datafusion/physical-plan—and pairing them with benchmarks—is the highest initial priority. This work also unblocks publishing the dedicated Range partitioning blog post.

Secondary Priority: Providers, Ecosystem, and Code Organization

While optimizer rules and execution nodes benefit all consumers, table providers, ecosystem serialization, and code modularity can be progressed in parallel:

Related Work and References

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