Skip to content

[CALCITE-7422] Support large plan optimization mode for HepPlanner#4803

Draft
zhuwenzhuang wants to merge 1 commit intoapache:mainfrom
zhuwenzhuang:large_plan_mode
Draft

[CALCITE-7422] Support large plan optimization mode for HepPlanner#4803
zhuwenzhuang wants to merge 1 commit intoapache:mainfrom
zhuwenzhuang:large_plan_mode

Conversation

@zhuwenzhuang
Copy link
Contributor

@zhuwenzhuang zhuwenzhuang commented Feb 24, 2026

Motivation and details: https://issues.apache.org/jira/browse/CALCITE-7422
Before:
LargePlanBenchmark:100 : 1s
LargePlanBenchmark:1000 : 9s
LargePlanBenchmark:10000 : pretty slow, cannot measure.

CPU Profiler Result(enable fired rules cache and disable large plan mode):
fireRule(RelOptRuleCall ruleCall) takes 2% cpu time.
image
Mem Profiler Result(enable fired rules cache and disable large plan mode):
image

After (enable fired rules cache and large plan mode):
LargePlanBenchmark:100 : 1s
LargePlanBenchmark:1000 : 2s
LargePlanBenchmark:10000 : about 60s

Benchmark (unionNum) Mode Cnt Score Error Units LargePlanBenchmark.testLargeUnionPlan 100 avgt 256.561 ms/op LargePlanBenchmark.testLargeUnionPlan 1000 avgt 1616.421 ms/op LargePlanBenchmark.testLargeUnionPlan 10000 avgt 53393.727 ms/op
CPU Profiler Result:
fireRule(RelOptRuleCall ruleCall) takes 11% cpu time. There is still lots of room for CPU optimization.
image

Mem Profiler Result:
(avoid buildListRecurse/collectGarbage, smaller memory peak size)
image

@zhuwenzhuang zhuwenzhuang force-pushed the large_plan_mode branch 6 times, most recently from d87d57a to d4ae34e Compare February 24, 2026 15:35
@zhuwenzhuang zhuwenzhuang marked this pull request as draft February 24, 2026 15:38
@zhuwenzhuang zhuwenzhuang force-pushed the large_plan_mode branch 2 times, most recently from 6369ba1 to 6d9ab05 Compare February 25, 2026 06:12
@sonarqubecloud
Copy link

@zhuwenzhuang
Copy link
Contributor Author

A better iterater implementation of DFS/BFS is needed. I will optimize this later (unavailable for the next two weeks).

@zhuwenzhuang zhuwenzhuang changed the title [CALCITE-7422] Support large plan optimizaion mode for HepPlanner [CALCITE-7422] Support large plan optimization mode for HepPlanner Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant