Skip to content

execution budget: bound joins, window functions, and set operations (V1 gap) #44

Description

@philcunliffe

Follow-up from PR #42 (execution budget). The V1 budget bounds ORDER BY, GROUP BY, the scalar-aggregate slow path, DISTINCT, and COUNT(DISTINCT). These unbounded buffering operators are NOT bounded yet and can still OOM a budgeted query:

  • Joins (src/execute/join.js): nested-loop buffers all right rows; positional buffers both sides; hash join buffers the entire build side + hashMap.
  • Window functions (src/execute/window.js): the non-streaming path buffers all child rows (+ partition map).
  • Set operations (src/execute/execute.js): UNION DISTINCT seen, INTERSECT rightKeys, EXCEPT rightKeys.

PR #42's ExecutionBudget doc honestly lists these as known V1 limitations. This issue tracks bounding them (charge each side's buffer into the same BufferBudget accountant, throwing QueryBudgetExceededError over the ceiling) so the budget is a complete memory-safety guarantee.

Ref: hypaware bounded-query-execution design LLP 0058, decision LLP 0056.

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