Skip to content

Avoid redundant LocalLimitExec when fetch is separated by a ProjectionExec #659

Description

@gabotechs

Problem

After the DataFusion 55 optimizer changes, a ProjectionExec can be placed above a fetch-bearing operator. ProjectionExec preserves row count, but the distributed fetch pushdown currently does not look through it. As a result, plans such as ClickBench q17 gain an unnecessary per-task LocalLimitExec.

Desired behavior

When determining whether to propagate a fetch into a NetworkCoalesceExec input stage, traverse through a ProjectionExec and evaluate the fetch on its child. Preserve the existing handling for GlobalLimitExec, including its skip adjustment.

Acceptance criteria

  • A fetch separated by a ProjectionExec is handled without adding the redundant LocalLimitExec.
  • Add a focused regression test for this plan shape.

Context

Follow-up from #540 (comment)

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions