Skip to content

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

@LantaoJin

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.

Metadata

Metadata

Assignees

Labels

calcitecalcite migration releatedenhancementNew feature or request

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions