Skip to content

[FEATURE] Skipping codegen and compile for Scan only plan #3852

Closed

Description

@LantaoJin

Is your feature request related to a problem?
Currently, when the Calcite engine is enabled, ​​all query plans​​ -- regardless of their structure -- are converted to EnumerableRel. This means the plan is transformed into a Linq4j Expression, generates Java code, and undergoes just-in-time (JIT) compilation before execution.

For ​​simple or fully pushdown-compatible queries​​ (e.g., source=t, source=t | where a=1, source=t | sort a, or source=t | where a=1 | sort b | head 10), the optimized plans end up as EnumerableTableScan. Despite their simplicity, these plans ​​unnecessarily undergo code generation and dynamic compilation​​, introducing overhead.

What solution would you like?
To ​​reduce codegen and compilation time​​, we propose converting such plans to BindableRel instead of EnumerableRel. This bypasses code generation and compilation entirely, ​​improving plan execution time by ~30%​​.

What alternatives have you considered?
A clear and concise description of any alternative solutions or features you've considered.

Do you have any additional context?
Add any other context or screenshots about the feature request here.

Activity

  1. added
    enhancement
    calcite
    and removed on Jul 7, 2025
  2. self-assigned this
    on Jul 7, 2025
  3. moved this from Not Started to In progress in PPL Trackeron Jul 7, 2025
  4. moved this from In progress to Done in PPL Trackeron Jul 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

calciteenhancement

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions