[ 
https://issues.apache.org/jira/browse/IGNITE-24741?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sergey Korotkov updated IGNITE-24741:
-------------------------------------
    Description: 
Sometimes produce error during planning in the attached test. See the log.

{noformat}
Suppressed: org.apache.calcite.plan.RelOptPlanner$CannotPlanException: There 
are not enough rules to produce a node with desired properties: 
convention=IGNITE, sort=[1 DESC-nulls-last], distr=single, 
rewindability=one-way, correlation=uncorrelated.
Missing conversions are LogicalJoin[convention: NONE -> IGNITE, sort: [] -> [6, 
1], distr: any -> single], LogicalJoin[convention: NONE -> IGNITE, sort: [] -> 
[6, 1]]
There are 2 empty subsets:
Empty subset 0: rel#2055:RelSubset#4.IGNITE.[6, 1].any.one-way.uncorrelated, 
the relevant part of the original plan is as follows
335:LogicalJoin(condition=[=($5, $2)], joinType=[inner])
  
332:LogicalJoin(subset=[rel#333:RelSubset#2.NONE.[].any.one-way.uncorrelated], 
condition=[=($0, $3)], joinType=[inner])
    
288:IgniteLogicalTableScan(subset=[rel#330:RelSubset#0.NONE.[].any.one-way.uncorrelated],
 table=[[PUBLIC, CUSTOMER]], requiredColumns=[{2, 5}])
    
295:IgniteLogicalTableScan(subset=[rel#331:RelSubset#1.NONE.[].any.one-way.uncorrelated],
 table=[[PUBLIC, ORDERS]], filters=[AND(>=($t2, 1994-01-01), <($t2, 
+(1994-01-01, *(12:INTERVAL YEAR, 1))))], requiredColumns=[{2, 3, 6}])
  
302:IgniteLogicalTableScan(subset=[rel#334:RelSubset#3.NONE.[].any.one-way.uncorrelated],
 table=[[PUBLIC, LINEITEM]], requiredColumns=[{2, 4, 7, 8}])

Empty subset 1: rel#2060:RelSubset#4.IGNITE.[6, 1].single.one-way.uncorrelated, 
the relevant part of the original plan is as follows
335:LogicalJoin(condition=[=($5, $2)], joinType=[inner])
  
332:LogicalJoin(subset=[rel#333:RelSubset#2.NONE.[].any.one-way.uncorrelated], 
condition=[=($0, $3)], joinType=[inner])
    
288:IgniteLogicalTableScan(subset=[rel#330:RelSubset#0.NONE.[].any.one-way.uncorrelated],
 table=[[PUBLIC, CUSTOMER]], requiredColumns=[{2, 5}])
    
295:IgniteLogicalTableScan(subset=[rel#331:RelSubset#1.NONE.[].any.one-way.uncorrelated],
 table=[[PUBLIC, ORDERS]], filters=[AND(>=($t2, 1994-01-01), <($t2, 
+(1994-01-01, *(12:INTERVAL YEAR, 1))))], requiredColumns=[{2, 3, 6}])
  
302:IgniteLogicalTableScan(subset=[rel#334:RelSubset#3.NONE.[].any.one-way.uncorrelated],
 table=[[PUBLIC, LINEITEM]], requiredColumns=[{2, 4, 7, 8}])
{noformat}
 
May be the reason is in this warning. It can be that cancel in random moment 
may cause the problem sometimes. Default timeout is 15 seconds and mat be 
changed via IGNITE_CALCITE_PLANNER_TIMEOUT.
{noformat}
[2025-03-11T13:25:38,068][WARN ][test-runner-#493%tpch.TpchQ5Test%][task] 
Volcano planning times out, cancels the subsequent optimization.
{noformat}



If enable the `calcite.volcano.dump.graphviz`=true and 
`calcite.volcano.dump.sets`=true (which are anabled by default) in case of 
error may produce a huge logs and hang in `VolcanoPlanner.dump` eating 
gigabytes of memory. Note in the below dump the *elapsed=570.01s allocated=378G*

 
{noformat}
"org.apache.ignite.internal.benchmarks.jmh.sql.tpch.TpchBenchmark.cold-jmh-worker-1"
 #22 daemon prio=5 os_prio=0 cpu=563001.94ms elapsed=570.01s allocated=378G 
defined_classes=115
93 tid=0x00007ad05d7a4000 nid=0x49b7e runnable  [0x00007ad0116fa000]
   java.lang.Thread.State: RUNNABLE
        at org.apache.calcite.plan.RelTraitSet.satisfies(RelTraitSet.java:496)
        at 
org.apache.calcite.plan.volcano.Dumpers.lambda$dumpGraphviz$2(Dumpers.java:183)
        at 
org.apache.calcite.plan.volcano.Dumpers$$Lambda$2624/0x0000000840ce7c40.lessThan(Unknown
 Source)
        at 
org.apache.calcite.util.PartiallyOrderedSet.findParentsChildren(PartiallyOrderedSet.java:340)
        at 
org.apache.calcite.util.PartiallyOrderedSet.findParents(PartiallyOrderedSet.java:315)
        at 
org.apache.calcite.util.PartiallyOrderedSet.add(PartiallyOrderedSet.java:233)
        at 
org.apache.calcite.plan.volcano.Dumpers.dumpGraphviz(Dumpers.java:239)
        at 
org.apache.calcite.plan.volcano.VolcanoPlanner.dump(VolcanoPlanner.java:869)
        at 
org.apache.calcite.plan.volcano.RelSubset$CheapestPlanReplacer.visit(RelSubset.java:715)
        at 
org.apache.calcite.plan.volcano.RelSubset.buildCheapestPlan(RelSubset.java:391)
        at 
org.apache.calcite.plan.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:534)
        at 
org.apache.calcite.tools.Programs$RuleSetProgram.run(Programs.java:328)
        at 
org.apache.ignite.internal.processors.query.calcite.prepare.IgnitePlanner.transform(IgnitePlanner.java:381)
        at 
org.apache.ignite.internal.processors.query.calcite.prepare.PlannerHelper.optimize(PlannerHelper.java:109)
        at 
org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareQuery(PrepareServiceImpl.java:168)
        at 
org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareSingle(PrepareServiceImpl.java:94)
        at 
org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.lambda$parseAndProcessQuery$5(CalciteQueryProcessor.java:553)
        at 
org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor$$Lambda$2039/0x00000008409d1440.get(Unknown
 Source)
        at 
org.apache.ignite.internal.processors.query.calcite.prepare.QueryPlanCacheImpl.lambda$queryPlan$0(QueryPlanCacheImpl.java:70)
        at 
org.apache.ignite.internal.processors.query.calcite.prepare.QueryPlanCacheImpl$$Lambda$2040/0x00000008409d1840.apply(Unknown
 Source)
        at 
java.util.concurrent.ConcurrentMap.computeIfAbsent([email protected]/ConcurrentMap.java:330)
        at 
org.apache.ignite.internal.processors.query.calcite.prepare.QueryPlanCacheImpl.queryPlan(QueryPlanCacheImpl.java:70)
        at 
org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.lambda$parseAndProcessQuery$6(CalciteQueryProcessor.java:550)
        at 
org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor$$Lambda$1996/0x000000084094f040.apply(Unknown
 Source)
        at 
org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.processQuery(CalciteQueryProcessor.java:701)
        at 
org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.parseAndProcessQuery(CalciteQueryProcessor.java:547)
        at 
org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.query(CalciteQueryProcessor.java:420)
        at 
org.apache.ignite.internal.processors.query.GridQueryProcessor$2.applyx(GridQueryProcessor.java:3119)
        at 
org.apache.ignite.internal.processors.query.GridQueryProcessor$2.applyx(GridQueryProcessor.java:3075)
        at 
org.apache.ignite.internal.util.lang.IgniteOutClosureX.apply(IgniteOutClosureX.java:36)
        at 
org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:3861)
        at 
org.apache.ignite.internal.processors.query.GridQueryProcessor.lambda$querySqlFields$3(GridQueryProcessor.java:3152)
        at 
org.apache.ignite.internal.processors.query.GridQueryProcessor$$Lambda$1990/0x000000084094b040.apply(Unknown
 Source)
        at 
org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuerySafe(GridQueryProcessor.java:3289)
        at 
org.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFields(GridQueryProcessor.java:3071)
        at 
org.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFields(GridQueryProcessor.java:2995)
        at 
org.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFields(GridQueryProcessor.java:2968)
        at 
org.apache.ignite.internal.benchmarks.jmh.sql.tpch.TpchBenchmark.sql(TpchBenchmark.java:259)
        at 
org.apache.ignite.internal.benchmarks.jmh.sql.tpch.TpchBenchmark.cold(TpchBenchmark.java:171)
        at 
org.apache.ignite.internal.benchmarks.jmh.sql.tpch.jmh_generated.TpchBenchmark_cold_jmhTest.cold_ss_jmhStub(TpchBenchmark_cold_jmhTest.java:416)
        at 
org.apache.ignite.internal.benchmarks.jmh.sql.tpch.jmh_generated.TpchBenchmark_cold_jmhTest.cold_SingleShotTime(TpchBenchmark_cold_jmhTest.java:371)
        at 
jdk.internal.reflect.NativeMethodAccessorImpl.invoke0([email protected]/Native 
Method)
        at 
jdk.internal.reflect.NativeMethodAccessorImpl.invoke([email protected]/NativeMethodAccessorImpl.java:62)
        at 
jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke([email protected]/DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke([email protected]/Method.java:566)
        at 
org.openjdk.jmh.runner.BenchmarkHandler$BenchmarkTask.call(BenchmarkHandler.java:475)
        at 
org.openjdk.jmh.runner.BenchmarkHandler$BenchmarkTask.call(BenchmarkHandler.java:458)
        at 
java.util.concurrent.FutureTask.run([email protected]/FutureTask.java:264)
        at 
java.util.concurrent.Executors$RunnableAdapter.call([email protected]/Executors.java:515)
        at 
java.util.concurrent.FutureTask.run([email protected]/FutureTask.java:264)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker([email protected]/ThreadPoolExecutor.java:1128)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run([email protected]/ThreadPoolExecutor.java:628)
        at java.lang.Thread.run([email protected]/Thread.java:829)
{noformat}

  was:
Sometimes produce error during planning in the attached test. See the log.

{noformat}
Suppressed: org.apache.calcite.plan.RelOptPlanner$CannotPlanException: There 
are not enough rules to produce a node with desired properties: 
convention=IGNITE, sort=[1 DESC-nulls-last], distr=single, 
rewindability=one-way, correlation=uncorrelated.
Missing conversions are LogicalJoin[convention: NONE -> IGNITE, sort: [] -> [6, 
1], distr: any -> single], LogicalJoin[convention: NONE -> IGNITE, sort: [] -> 
[6, 1]]
There are 2 empty subsets:
Empty subset 0: rel#2055:RelSubset#4.IGNITE.[6, 1].any.one-way.uncorrelated, 
the relevant part of the original plan is as follows
335:LogicalJoin(condition=[=($5, $2)], joinType=[inner])
  
332:LogicalJoin(subset=[rel#333:RelSubset#2.NONE.[].any.one-way.uncorrelated], 
condition=[=($0, $3)], joinType=[inner])
    
288:IgniteLogicalTableScan(subset=[rel#330:RelSubset#0.NONE.[].any.one-way.uncorrelated],
 table=[[PUBLIC, CUSTOMER]], requiredColumns=[{2, 5}])
    
295:IgniteLogicalTableScan(subset=[rel#331:RelSubset#1.NONE.[].any.one-way.uncorrelated],
 table=[[PUBLIC, ORDERS]], filters=[AND(>=($t2, 1994-01-01), <($t2, 
+(1994-01-01, *(12:INTERVAL YEAR, 1))))], requiredColumns=[{2, 3, 6}])
  
302:IgniteLogicalTableScan(subset=[rel#334:RelSubset#3.NONE.[].any.one-way.uncorrelated],
 table=[[PUBLIC, LINEITEM]], requiredColumns=[{2, 4, 7, 8}])

Empty subset 1: rel#2060:RelSubset#4.IGNITE.[6, 1].single.one-way.uncorrelated, 
the relevant part of the original plan is as follows
335:LogicalJoin(condition=[=($5, $2)], joinType=[inner])
  
332:LogicalJoin(subset=[rel#333:RelSubset#2.NONE.[].any.one-way.uncorrelated], 
condition=[=($0, $3)], joinType=[inner])
    
288:IgniteLogicalTableScan(subset=[rel#330:RelSubset#0.NONE.[].any.one-way.uncorrelated],
 table=[[PUBLIC, CUSTOMER]], requiredColumns=[{2, 5}])
    
295:IgniteLogicalTableScan(subset=[rel#331:RelSubset#1.NONE.[].any.one-way.uncorrelated],
 table=[[PUBLIC, ORDERS]], filters=[AND(>=($t2, 1994-01-01), <($t2, 
+(1994-01-01, *(12:INTERVAL YEAR, 1))))], requiredColumns=[{2, 3, 6}])
  
302:IgniteLogicalTableScan(subset=[rel#334:RelSubset#3.NONE.[].any.one-way.uncorrelated],
 table=[[PUBLIC, LINEITEM]], requiredColumns=[{2, 4, 7, 8}])
{noformat}

If enable the `calcite.volcano.dump.graphviz`=true and 
`calcite.volcano.dump.sets`=true (which are anabled by default) in case of 
error may produce a huge logs and hang in `VolcanoPlanner.dump` eating 
gigabytes of memory. Note in the below dump the *elapsed=570.01s allocated=378G*

 
{noformat}
"org.apache.ignite.internal.benchmarks.jmh.sql.tpch.TpchBenchmark.cold-jmh-worker-1"
 #22 daemon prio=5 os_prio=0 cpu=563001.94ms elapsed=570.01s allocated=378G 
defined_classes=115
93 tid=0x00007ad05d7a4000 nid=0x49b7e runnable  [0x00007ad0116fa000]
   java.lang.Thread.State: RUNNABLE
        at org.apache.calcite.plan.RelTraitSet.satisfies(RelTraitSet.java:496)
        at 
org.apache.calcite.plan.volcano.Dumpers.lambda$dumpGraphviz$2(Dumpers.java:183)
        at 
org.apache.calcite.plan.volcano.Dumpers$$Lambda$2624/0x0000000840ce7c40.lessThan(Unknown
 Source)
        at 
org.apache.calcite.util.PartiallyOrderedSet.findParentsChildren(PartiallyOrderedSet.java:340)
        at 
org.apache.calcite.util.PartiallyOrderedSet.findParents(PartiallyOrderedSet.java:315)
        at 
org.apache.calcite.util.PartiallyOrderedSet.add(PartiallyOrderedSet.java:233)
        at 
org.apache.calcite.plan.volcano.Dumpers.dumpGraphviz(Dumpers.java:239)
        at 
org.apache.calcite.plan.volcano.VolcanoPlanner.dump(VolcanoPlanner.java:869)
        at 
org.apache.calcite.plan.volcano.RelSubset$CheapestPlanReplacer.visit(RelSubset.java:715)
        at 
org.apache.calcite.plan.volcano.RelSubset.buildCheapestPlan(RelSubset.java:391)
        at 
org.apache.calcite.plan.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:534)
        at 
org.apache.calcite.tools.Programs$RuleSetProgram.run(Programs.java:328)
        at 
org.apache.ignite.internal.processors.query.calcite.prepare.IgnitePlanner.transform(IgnitePlanner.java:381)
        at 
org.apache.ignite.internal.processors.query.calcite.prepare.PlannerHelper.optimize(PlannerHelper.java:109)
        at 
org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareQuery(PrepareServiceImpl.java:168)
        at 
org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareSingle(PrepareServiceImpl.java:94)
        at 
org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.lambda$parseAndProcessQuery$5(CalciteQueryProcessor.java:553)
        at 
org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor$$Lambda$2039/0x00000008409d1440.get(Unknown
 Source)
        at 
org.apache.ignite.internal.processors.query.calcite.prepare.QueryPlanCacheImpl.lambda$queryPlan$0(QueryPlanCacheImpl.java:70)
        at 
org.apache.ignite.internal.processors.query.calcite.prepare.QueryPlanCacheImpl$$Lambda$2040/0x00000008409d1840.apply(Unknown
 Source)
        at 
java.util.concurrent.ConcurrentMap.computeIfAbsent([email protected]/ConcurrentMap.java:330)
        at 
org.apache.ignite.internal.processors.query.calcite.prepare.QueryPlanCacheImpl.queryPlan(QueryPlanCacheImpl.java:70)
        at 
org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.lambda$parseAndProcessQuery$6(CalciteQueryProcessor.java:550)
        at 
org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor$$Lambda$1996/0x000000084094f040.apply(Unknown
 Source)
        at 
org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.processQuery(CalciteQueryProcessor.java:701)
        at 
org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.parseAndProcessQuery(CalciteQueryProcessor.java:547)
        at 
org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.query(CalciteQueryProcessor.java:420)
        at 
org.apache.ignite.internal.processors.query.GridQueryProcessor$2.applyx(GridQueryProcessor.java:3119)
        at 
org.apache.ignite.internal.processors.query.GridQueryProcessor$2.applyx(GridQueryProcessor.java:3075)
        at 
org.apache.ignite.internal.util.lang.IgniteOutClosureX.apply(IgniteOutClosureX.java:36)
        at 
org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:3861)
        at 
org.apache.ignite.internal.processors.query.GridQueryProcessor.lambda$querySqlFields$3(GridQueryProcessor.java:3152)
        at 
org.apache.ignite.internal.processors.query.GridQueryProcessor$$Lambda$1990/0x000000084094b040.apply(Unknown
 Source)
        at 
org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuerySafe(GridQueryProcessor.java:3289)
        at 
org.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFields(GridQueryProcessor.java:3071)
        at 
org.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFields(GridQueryProcessor.java:2995)
        at 
org.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFields(GridQueryProcessor.java:2968)
        at 
org.apache.ignite.internal.benchmarks.jmh.sql.tpch.TpchBenchmark.sql(TpchBenchmark.java:259)
        at 
org.apache.ignite.internal.benchmarks.jmh.sql.tpch.TpchBenchmark.cold(TpchBenchmark.java:171)
        at 
org.apache.ignite.internal.benchmarks.jmh.sql.tpch.jmh_generated.TpchBenchmark_cold_jmhTest.cold_ss_jmhStub(TpchBenchmark_cold_jmhTest.java:416)
        at 
org.apache.ignite.internal.benchmarks.jmh.sql.tpch.jmh_generated.TpchBenchmark_cold_jmhTest.cold_SingleShotTime(TpchBenchmark_cold_jmhTest.java:371)
        at 
jdk.internal.reflect.NativeMethodAccessorImpl.invoke0([email protected]/Native 
Method)
        at 
jdk.internal.reflect.NativeMethodAccessorImpl.invoke([email protected]/NativeMethodAccessorImpl.java:62)
        at 
jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke([email protected]/DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke([email protected]/Method.java:566)
        at 
org.openjdk.jmh.runner.BenchmarkHandler$BenchmarkTask.call(BenchmarkHandler.java:475)
        at 
org.openjdk.jmh.runner.BenchmarkHandler$BenchmarkTask.call(BenchmarkHandler.java:458)
        at 
java.util.concurrent.FutureTask.run([email protected]/FutureTask.java:264)
        at 
java.util.concurrent.Executors$RunnableAdapter.call([email protected]/Executors.java:515)
        at 
java.util.concurrent.FutureTask.run([email protected]/FutureTask.java:264)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker([email protected]/ThreadPoolExecutor.java:1128)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run([email protected]/ThreadPoolExecutor.java:628)
        at java.lang.Thread.run([email protected]/Thread.java:829)
{noformat}


> Calcite. TPC-H query #5: failed to plan query
> ---------------------------------------------
>
>                 Key: IGNITE-24741
>                 URL: https://issues.apache.org/jira/browse/IGNITE-24741
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Sergey Korotkov
>            Priority: Major
>              Labels: ise, tpch
>         Attachments: TpchQ5Test.java, TpchQ5Test.log
>
>
> Sometimes produce error during planning in the attached test. See the log.
> {noformat}
> Suppressed: org.apache.calcite.plan.RelOptPlanner$CannotPlanException: There 
> are not enough rules to produce a node with desired properties: 
> convention=IGNITE, sort=[1 DESC-nulls-last], distr=single, 
> rewindability=one-way, correlation=uncorrelated.
> Missing conversions are LogicalJoin[convention: NONE -> IGNITE, sort: [] -> 
> [6, 1], distr: any -> single], LogicalJoin[convention: NONE -> IGNITE, sort: 
> [] -> [6, 1]]
> There are 2 empty subsets:
> Empty subset 0: rel#2055:RelSubset#4.IGNITE.[6, 1].any.one-way.uncorrelated, 
> the relevant part of the original plan is as follows
> 335:LogicalJoin(condition=[=($5, $2)], joinType=[inner])
>   
> 332:LogicalJoin(subset=[rel#333:RelSubset#2.NONE.[].any.one-way.uncorrelated],
>  condition=[=($0, $3)], joinType=[inner])
>     
> 288:IgniteLogicalTableScan(subset=[rel#330:RelSubset#0.NONE.[].any.one-way.uncorrelated],
>  table=[[PUBLIC, CUSTOMER]], requiredColumns=[{2, 5}])
>     
> 295:IgniteLogicalTableScan(subset=[rel#331:RelSubset#1.NONE.[].any.one-way.uncorrelated],
>  table=[[PUBLIC, ORDERS]], filters=[AND(>=($t2, 1994-01-01), <($t2, 
> +(1994-01-01, *(12:INTERVAL YEAR, 1))))], requiredColumns=[{2, 3, 6}])
>   
> 302:IgniteLogicalTableScan(subset=[rel#334:RelSubset#3.NONE.[].any.one-way.uncorrelated],
>  table=[[PUBLIC, LINEITEM]], requiredColumns=[{2, 4, 7, 8}])
> Empty subset 1: rel#2060:RelSubset#4.IGNITE.[6, 
> 1].single.one-way.uncorrelated, the relevant part of the original plan is as 
> follows
> 335:LogicalJoin(condition=[=($5, $2)], joinType=[inner])
>   
> 332:LogicalJoin(subset=[rel#333:RelSubset#2.NONE.[].any.one-way.uncorrelated],
>  condition=[=($0, $3)], joinType=[inner])
>     
> 288:IgniteLogicalTableScan(subset=[rel#330:RelSubset#0.NONE.[].any.one-way.uncorrelated],
>  table=[[PUBLIC, CUSTOMER]], requiredColumns=[{2, 5}])
>     
> 295:IgniteLogicalTableScan(subset=[rel#331:RelSubset#1.NONE.[].any.one-way.uncorrelated],
>  table=[[PUBLIC, ORDERS]], filters=[AND(>=($t2, 1994-01-01), <($t2, 
> +(1994-01-01, *(12:INTERVAL YEAR, 1))))], requiredColumns=[{2, 3, 6}])
>   
> 302:IgniteLogicalTableScan(subset=[rel#334:RelSubset#3.NONE.[].any.one-way.uncorrelated],
>  table=[[PUBLIC, LINEITEM]], requiredColumns=[{2, 4, 7, 8}])
> {noformat}
>  
> May be the reason is in this warning. It can be that cancel in random moment 
> may cause the problem sometimes. Default timeout is 15 seconds and mat be 
> changed via IGNITE_CALCITE_PLANNER_TIMEOUT.
> {noformat}
> [2025-03-11T13:25:38,068][WARN ][test-runner-#493%tpch.TpchQ5Test%][task] 
> Volcano planning times out, cancels the subsequent optimization.
> {noformat}
> If enable the `calcite.volcano.dump.graphviz`=true and 
> `calcite.volcano.dump.sets`=true (which are anabled by default) in case of 
> error may produce a huge logs and hang in `VolcanoPlanner.dump` eating 
> gigabytes of memory. Note in the below dump the *elapsed=570.01s 
> allocated=378G*
>  
> {noformat}
> "org.apache.ignite.internal.benchmarks.jmh.sql.tpch.TpchBenchmark.cold-jmh-worker-1"
>  #22 daemon prio=5 os_prio=0 cpu=563001.94ms elapsed=570.01s allocated=378G 
> defined_classes=115
> 93 tid=0x00007ad05d7a4000 nid=0x49b7e runnable  [0x00007ad0116fa000]
>    java.lang.Thread.State: RUNNABLE
>         at org.apache.calcite.plan.RelTraitSet.satisfies(RelTraitSet.java:496)
>         at 
> org.apache.calcite.plan.volcano.Dumpers.lambda$dumpGraphviz$2(Dumpers.java:183)
>         at 
> org.apache.calcite.plan.volcano.Dumpers$$Lambda$2624/0x0000000840ce7c40.lessThan(Unknown
>  Source)
>         at 
> org.apache.calcite.util.PartiallyOrderedSet.findParentsChildren(PartiallyOrderedSet.java:340)
>         at 
> org.apache.calcite.util.PartiallyOrderedSet.findParents(PartiallyOrderedSet.java:315)
>         at 
> org.apache.calcite.util.PartiallyOrderedSet.add(PartiallyOrderedSet.java:233)
>         at 
> org.apache.calcite.plan.volcano.Dumpers.dumpGraphviz(Dumpers.java:239)
>         at 
> org.apache.calcite.plan.volcano.VolcanoPlanner.dump(VolcanoPlanner.java:869)
>         at 
> org.apache.calcite.plan.volcano.RelSubset$CheapestPlanReplacer.visit(RelSubset.java:715)
>         at 
> org.apache.calcite.plan.volcano.RelSubset.buildCheapestPlan(RelSubset.java:391)
>         at 
> org.apache.calcite.plan.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:534)
>         at 
> org.apache.calcite.tools.Programs$RuleSetProgram.run(Programs.java:328)
>         at 
> org.apache.ignite.internal.processors.query.calcite.prepare.IgnitePlanner.transform(IgnitePlanner.java:381)
>         at 
> org.apache.ignite.internal.processors.query.calcite.prepare.PlannerHelper.optimize(PlannerHelper.java:109)
>         at 
> org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareQuery(PrepareServiceImpl.java:168)
>         at 
> org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareSingle(PrepareServiceImpl.java:94)
>         at 
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.lambda$parseAndProcessQuery$5(CalciteQueryProcessor.java:553)
>         at 
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor$$Lambda$2039/0x00000008409d1440.get(Unknown
>  Source)
>         at 
> org.apache.ignite.internal.processors.query.calcite.prepare.QueryPlanCacheImpl.lambda$queryPlan$0(QueryPlanCacheImpl.java:70)
>         at 
> org.apache.ignite.internal.processors.query.calcite.prepare.QueryPlanCacheImpl$$Lambda$2040/0x00000008409d1840.apply(Unknown
>  Source)
>         at 
> java.util.concurrent.ConcurrentMap.computeIfAbsent([email protected]/ConcurrentMap.java:330)
>         at 
> org.apache.ignite.internal.processors.query.calcite.prepare.QueryPlanCacheImpl.queryPlan(QueryPlanCacheImpl.java:70)
>         at 
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.lambda$parseAndProcessQuery$6(CalciteQueryProcessor.java:550)
>         at 
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor$$Lambda$1996/0x000000084094f040.apply(Unknown
>  Source)
>         at 
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.processQuery(CalciteQueryProcessor.java:701)
>         at 
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.parseAndProcessQuery(CalciteQueryProcessor.java:547)
>         at 
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.query(CalciteQueryProcessor.java:420)
>         at 
> org.apache.ignite.internal.processors.query.GridQueryProcessor$2.applyx(GridQueryProcessor.java:3119)
>         at 
> org.apache.ignite.internal.processors.query.GridQueryProcessor$2.applyx(GridQueryProcessor.java:3075)
>         at 
> org.apache.ignite.internal.util.lang.IgniteOutClosureX.apply(IgniteOutClosureX.java:36)
>         at 
> org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:3861)
>         at 
> org.apache.ignite.internal.processors.query.GridQueryProcessor.lambda$querySqlFields$3(GridQueryProcessor.java:3152)
>         at 
> org.apache.ignite.internal.processors.query.GridQueryProcessor$$Lambda$1990/0x000000084094b040.apply(Unknown
>  Source)
>         at 
> org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuerySafe(GridQueryProcessor.java:3289)
>         at 
> org.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFields(GridQueryProcessor.java:3071)
>         at 
> org.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFields(GridQueryProcessor.java:2995)
>         at 
> org.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFields(GridQueryProcessor.java:2968)
>         at 
> org.apache.ignite.internal.benchmarks.jmh.sql.tpch.TpchBenchmark.sql(TpchBenchmark.java:259)
>         at 
> org.apache.ignite.internal.benchmarks.jmh.sql.tpch.TpchBenchmark.cold(TpchBenchmark.java:171)
>         at 
> org.apache.ignite.internal.benchmarks.jmh.sql.tpch.jmh_generated.TpchBenchmark_cold_jmhTest.cold_ss_jmhStub(TpchBenchmark_cold_jmhTest.java:416)
>         at 
> org.apache.ignite.internal.benchmarks.jmh.sql.tpch.jmh_generated.TpchBenchmark_cold_jmhTest.cold_SingleShotTime(TpchBenchmark_cold_jmhTest.java:371)
>         at 
> jdk.internal.reflect.NativeMethodAccessorImpl.invoke0([email protected]/Native
>  Method)
>         at 
> jdk.internal.reflect.NativeMethodAccessorImpl.invoke([email protected]/NativeMethodAccessorImpl.java:62)
>         at 
> jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke([email protected]/DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke([email protected]/Method.java:566)
>         at 
> org.openjdk.jmh.runner.BenchmarkHandler$BenchmarkTask.call(BenchmarkHandler.java:475)
>         at 
> org.openjdk.jmh.runner.BenchmarkHandler$BenchmarkTask.call(BenchmarkHandler.java:458)
>         at 
> java.util.concurrent.FutureTask.run([email protected]/FutureTask.java:264)
>         at 
> java.util.concurrent.Executors$RunnableAdapter.call([email protected]/Executors.java:515)
>         at 
> java.util.concurrent.FutureTask.run([email protected]/FutureTask.java:264)
>         at 
> java.util.concurrent.ThreadPoolExecutor.runWorker([email protected]/ThreadPoolExecutor.java:1128)
>         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run([email protected]/ThreadPoolExecutor.java:628)
>         at java.lang.Thread.run([email protected]/Thread.java:829)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to