Skip to content

[EPIC] Simplify memory-limited (spilling) execution #26711

Open

Description

@alamb

Describe the problem

Collects the existing issues so the special cases can be revisited together rather than one at a time.

Memory-limited execution has grown by accretion and is hard to reason about as @2010YOUY01 and @andygrove point out in #25853 (comment).

Each spilling operator (sort, aggregate, sort-merge join, nested loop join, repartition) has fixed its own out-of-memory failures with a local special case, and the shared pieces such as StreamingMergeBuilder, MultiLevelMergeBuilder and SpillManager have picked up knobs that only one caller sets.

For example, the spill merge now has three options that only aggregate spilling uses (with_replay_headroom, with_intermediate_merge_sizing and with_max_batch_bytes)

The result is hard to reason about locally

Issues

Shared spill and merge infrastructure

Aggregate

Sort

Testing

Related discussions and epics

Activity

  1. added
    enhancementNew feature or request
    EPICA larger project, actively underway, with sub tasks
    tech debtCode complexity, duplication or structure that makes the codebase harder to change
    on Oct 24, 2026
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

    EPICA larger project, actively underway, with sub tasksenhancementNew feature or requesttech debtCode complexity, duplication or structure that makes the codebase harder to change

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions