You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by Enrico Olivelli <eo...@gmail.com> on 2018/09/22 09:42:45 UTC

Help with EnumerableMergeJoinRule which is losing a RelCollection trait

Hi,
We found a strange behaviour in an execution plan, basially we have an
EnumerableMergeJoin which has as input two non-sorted
EnumerableTableScan

all the details are in this issue on HerdDB

https://github.com/diennea/herddb/issues/262#issuecomment-423590573

Cut and paste from the issue in the bottom of this email

Any help is very appreciated, maybe some ring bells ....

[ISSUE]

query:
SELECT * FROM license t0, customer c WHERE c.customer_id = t0.customer_id

It seems that Calcite is planning a Merge Join, but the tables are not
sorted according to the merge keys.

"License" table:
TABLE PK (non clustered): [license_id]
COL: license_id serialPos: 0 (serialPos is the index of the colum for Calcite)
COL: application serialPos: 1
COL: creation serialPos: 2
COL: data serialPos: 3
COL: deleted serialPos: 4
COL: modification serialPos: 5
COL: signature serialPos: 6
COL: customer_id serialPos: 7

"Customer" table:
TABLE PK (non clustered): [customer_id]
COL: customer_id serialPos: 0
COL: contact_email serialPos: 1
COL: contact_person serialPos: 2
COL: creation serialPos: 3
COL: deleted serialPos: 4
COL: modification serialPos: 5
COL: name serialPos: 6
COL: vetting serialPos: 7

the join is on PK (non clustered) column of table customer,
and the "customer_id" column of table 'license' which is not sorted
naturally by 'customerid' (we do not have clustered indexes !!)

This is the plan:

EnumerableMergeJoin(condition=[=($7, $9)], joinType=[inner]): rowcount
= 15.75, cumulative cost = {59.75 rows, 24.0 cpu, 0.0 io}, id = 114
EnumerableTableScan(table=[[herd, license]]): rowcount = 15.0,
cumulative cost = {15.0 rows, 16.0 cpu, 0.0 io}, id = 28
EnumerableTableScan(table=[[herd, customer]]): rowcount = 7.0,
cumulative cost = {7.0 rows, 8.0 cpu, 0.0 io}, id = 29

EnumerableTableScan does not contain any information which tells that
the Scan MUST be sorted according to the join keys (field 7 in
"licence", and field 0 in "customer")

Here in Calcite code the additional 'Collation' is lost as the
"replace" does not contain any 'RelCollation', so the inputs of the
join are not transformed

https://github.com/apache/calcite/blob/2ab83e468d282a9428e533853aea5253816889fb/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableMergeJoinRule.java#L78

is it a bug in Calcite or in how we are passing data to Calcite ?
Tables do not have any impliticit "collation" in HerdDB so we are not
passing any 'RelCollation'


Thank you

Enrico

Re: Help with EnumerableMergeJoinRule which is losing a RelCollection trait

Posted by Enrico Olivelli <eo...@gmail.com>.
Il sab 29 set 2018, 00:20 Stamatis Zampetakis <za...@gmail.com> ha
scritto:

> Have a look in CalcitePrepareImpl (
>
> https://github.com/apache/calcite/blob/3a4fba828f3d9e48749fadd22f134891612b7072/core/src/main/java/org/apache/calcite/prepare/CalcitePrepareImpl.java#L1109
> )
>
> Possibly you need a few lines like below:
>
> final RelCollation collation =
>           rel instanceof Sort
>               ? ((Sort) rel).collation
>               : RelCollations.EMPTY;
>



Actually using a variation of this fix works, or at least all tests are
passing again.

Thank you very much !

Enrico





>
>
> Στις Παρ, 28 Σεπ 2018 στις 11:39 μ.μ., ο/η Enrico Olivelli <
> eolivelli@gmail.com> έγραψε:
>
> > Il ven 28 set 2018, 23:00 Stamatis Zampetakis <za...@gmail.com> ha
> > scritto:
> >
> > > Hi Enrico,
> > >
> > > I didn't look thoroughly but I suspect that maybe the problem is when
> you
> > > set the desiredTraits (
> > >
> > >
> >
> https://github.com/diennea/herddb/blob/0c7c01584350d57d8102511b987e5f880f3f65bd/herddb-core/src/main/java/herddb/sql/CalcitePlanner.java#L449
> > > ).
> > > Apart from the EnumerableConvention, I think you should also set the
> > > expected RelCollationTrait. Can you check what are the desiredTraits
> that
> > > you are passing to the optimizer?
> > >
> >
> > Stamatis
> > You see correctly that I am passing only EnumerableConvention as
> > desiredTraits.
> > I can't find the 'Trait' for RelCollation, there is no constant
> > like EnumerableConvention.
> > Is there anya special way to instantiate it?
> > I can't find and examplethe in Calcite tests
> >
> > Thank you so much
> > Enrico
> >
> >
> >
> > > Best,
> > > Stamatis
> > >
> > > Στις Παρ, 28 Σεπ 2018 στις 9:58 μ.μ., ο/η Enrico Olivelli <
> > > eolivelli@gmail.com> έγραψε:
> > >
> > > > Sorry  in advance for this very long email....
> > > > I am trying to debug, but I honestly I did not undestand clearly how
> > > > these rules work
> > > >
> > > > I have this query:
> > > > SELECT `tsql`.`k1`, `tsql`.`n1`, `tsql`.`s1`
> > > > FROM `tblspace1`.`tsql` AS `TSQL`
> > > >
> > > > This is the table:
> > > > CREATE TABLE tblspace1.tsql (k1 string primary key,n1 int,s1 string)
> > > >
> > > > Logical Plan Starts with:
> > > > LogicalSort(sort0=[$0], dir0=[ASC])
> > > >   LogicalProject(k1=[$0], n1=[$1], s1=[$2])
> > > >     LogicalTableScan(table=[[tblspace1, tsql]])
> > > >
> > > > And the Best Exp eventually is:
> > > > EnumerableTableScan(table=[[tblspace1, tsql]]): rowcount = 1.0,
> > > > cumulative cost = {1.0 rows, 2.0 cpu, 0.0 io}, id = 33
> > > >
> > > > The problem is that the Sort disappears.
> > > > The Table is configured with Statistics without any Collation
> > > > Statistics.of(tableManager.getStats().getTablesize(), keys)
> > > >
> > > > This happens if I enable these traits on the Planner:
> > > > ConventionTraitDef.INSTANCE, RelCollationTraitDef.INSTANCE
> > > >
> > > > if I enable only ConventionTraitDef the sort does not disappear
> > > >
> > > > These are "TRACE" level logs of the Planner
> > > >
> > > > Maybe some expert of you can see inside the logs the anwer to my
> > problem.
> > > >
> > > > Thank you in advace, I know that your time is valuable. I appreciate
> > > > any kind of help
> > > >
> > > > Enrico
> > > >
> > > >
> > > > [main] TRACE org.apache.calcite.sql.parser - After validation: SELECT
> > > > `tsql`.`k1`, `tsql`.`n1`, `tsql`.`s1`
> > > > FROM `tblspace1`.`tsql` AS `TSQL`
> > > > ORDER BY `K1`
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> > > > LogicalTableScan#30
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> > > LogicalProject#31
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> LogicalSort#32
> > > > [main] DEBUG org.apache.calcite.sql2rel - Plan after converting
> > > > SqlNode to RelNode
> > > > LogicalSort(sort0=[$0], dir0=[ASC])
> > > >   LogicalProject(k1=[$0], n1=[$1], s1=[$2])
> > > >     LogicalTableScan(table=[[tblspace1, tsql]])
> > > >
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> > > > EnumerableTableScan#33
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> > > LogicalProject#34
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> LogicalSort#35
> > > > Query: select * from tblspace1.tsql order by k1
> > > > -- Best  Plan
> > > > LogicalSort(sort0=[$0], dir0=[ASC]): rowcount = 1.0, cumulative cost
> =
> > > > {3.0 rows, 17.0 cpu, 0.0 io}, id = 35
> > > >   LogicalProject(k1=[$0], n1=[$1], s1=[$2]): rowcount = 1.0,
> > > > cumulative cost = {2.0 rows, 5.0 cpu, 0.0 io}, id = 34
> > > >     EnumerableTableScan(table=[[tblspace1, tsql]]): rowcount = 1.0,
> > > > cumulative cost = {1.0 rows, 2.0 cpu, 0.0 io}, id = 33
> > > >
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#36
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Subset cost
> > > > improved: subset [rel#36:Subset#0.ENUMERABLE.[]] cost was {inf} now
> > > > {1.0 rows, 2.0 cpu, 0.0 io}
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
> > > > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql]) in
> > > > rel#36:Subset#0.ENUMERABLE.[]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > > [rel#36:Subset#0.ENUMERABLE.[]] is 0.0
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> > > LogicalProject#37
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#38
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
> > > >
> > > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)
> > > > in rel#38:Subset#1.NONE.[]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > > [rel#36:Subset#0.ENUMERABLE.[]] to its parent
> > > > [rel#38:Subset#1.NONE.[]] is 0.0 (parent importance=0.0, child
> > > > cost=3.0, parent cost=1.0E30)
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > > [rel#36:Subset#0.ENUMERABLE.[]] is 0.0
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > > [rel#38:Subset#1.NONE.[]] is 0.0
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > > Rule-match queued: rule [EnumerableProjectRule] rels
> > > >
> > > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > > Rule-match queued: rule [ProjectRemoveRule] rels
> > > >
> > > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > > Rule-match queued: rule [ProjectScanRule] rels
> > > >
> > > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> LogicalSort#39
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#40
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
> > > >
> > > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)
> > > > in rel#40:Subset#2.NONE.[0]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > > [rel#38:Subset#1.NONE.[]] to its parent [rel#40:Subset#2.NONE.[0]] is
> > > > 0.0 (parent importance=0.0, child cost=1.0E30, parent cost=1.0E30)
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > > [rel#38:Subset#1.NONE.[]] is 0.0
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > > [rel#40:Subset#2.NONE.[0]] is 0.0
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > > Rule-match queued: rule [SortRemoveConstantKeysRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > > Rule-match queued: rule [PruneSortLimit0] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > > Rule-match queued: rule [EnumerableSortRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > > Rule-match queued: rule [SortProjectTransposeRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > > >
> > > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > > Rule-match queued: rule [SortRemoveRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > > Rule-match queued: rule [EnumerableLimitRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#41
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > > > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 1/1;
> > > > PHASE = PRE_PROCESS_MDR; COST = {inf}
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > > > rel#41:Subset#2.ENUMERABLE.[]
> > > > Original rel:
> > > > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > > > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > > > 0.0 io}, id = 39
> > > >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> > > > s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> > > > io}, id = 37
> > > >     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> > > > table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> > > > rows, 2.0 cpu, 0.0 io}, id = 33
> > > >
> > > > Sets:
> > > > Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > > >     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.0
> > > >         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> > > > tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> > > > Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > > >     rel#38:Subset#1.NONE.[], best=null, importance=0.0
> > > >
> > > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > > rowcount=1.0, cumulative cost={inf}
> > > > Set#2, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > > >     rel#40:Subset#2.NONE.[0], best=null, importance=0.0
> > > >
> > > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >     rel#41:Subset#2.ENUMERABLE.[], best=null, importance=0.0
> > > >
> > > > Importances: { rel#36:Subset#0.ENUMERABLE.[]=0.0
> > > > rel#38:Subset#1.NONE.[]=0.0 rel#40:Subset#2.NONE.[0]=0.0}
> > > >
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > > > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 2/1;
> > > > PHASE = PRE_PROCESS; COST = {inf}
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > > > rel#41:Subset#2.ENUMERABLE.[]
> > > > Original rel:
> > > > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > > > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > > > 0.0 io}, id = 39
> > > >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> > > > s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> > > > io}, id = 37
> > > >     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> > > > table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> > > > rows, 2.0 cpu, 0.0 io}, id = 33
> > > >
> > > > Sets:
> > > > Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > > >     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.0
> > > >         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> > > > tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> > > > Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > > >     rel#38:Subset#1.NONE.[], best=null, importance=0.0
> > > >
> > > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > > rowcount=1.0, cumulative cost={inf}
> > > > Set#2, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > > >     rel#40:Subset#2.NONE.[0], best=null, importance=0.0
> > > >
> > > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >     rel#41:Subset#2.ENUMERABLE.[], best=null, importance=0.0
> > > >
> > > > Importances: { rel#36:Subset#0.ENUMERABLE.[]=0.0
> > > > rel#38:Subset#1.NONE.[]=0.0 rel#40:Subset#2.NONE.[0]=0.0}
> > > >
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > > > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 3/1;
> > > > PHASE = OPTIMIZE; COST = {inf}
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > > > rel#41:Subset#2.ENUMERABLE.[]
> > > > Original rel:
> > > > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > > > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > > > 0.0 io}, id = 39
> > > >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> > > > s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> > > > io}, id = 37
> > > >     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> > > > table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> > > > rows, 2.0 cpu, 0.0 io}, id = 33
> > > >
> > > > Sets:
> > > > Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > > >     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.0
> > > >         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> > > > tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> > > > Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > > >     rel#38:Subset#1.NONE.[], best=null, importance=0.0
> > > >
> > > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > > rowcount=1.0, cumulative cost={inf}
> > > > Set#2, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > > >     rel#40:Subset#2.NONE.[0], best=null, importance=0.0
> > > >
> > > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >     rel#41:Subset#2.ENUMERABLE.[], best=null, importance=0.0
> > > >
> > > > Importances: { rel#36:Subset#0.ENUMERABLE.[]=0.0
> > > > rel#38:Subset#1.NONE.[]=0.0 rel#40:Subset#2.NONE.[0]=0.0}
> > > >
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule
> queue:
> > > > rule [SortRemoveConstantKeysRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.0
> > > > rule [SortProjectTransposeRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > > >
> > > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.0
> > > > rule [PruneSortLimit0] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.0
> > > > rule [ProjectScanRule] rels
> > > >
> > > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> > > > importance 0.0
> > > > rule [ProjectRemoveRule] rels
> > > >
> > > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.0
> > > > rule [EnumerableSortRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.0
> > > > rule [EnumerableProjectRule] rels
> > > >
> > > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.0
> > > > rule [EnumerableLimitRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.0
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> > > > [SortRemoveRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#446: Apply
> > > > rule [SortRemoveRule] to
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#42
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
> > > > rel#42 via SortRemoveRule
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - call#446: Rule
> > > > SortRemoveRule arguments
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > created rel#42:RelSubset
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Merge set#2 into
> > > set#1
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#43
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> > > > AbstractConverter#44
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
> > > >
> > > >
> > >
> >
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[])
> > > > in rel#43:Subset#1.ENUMERABLE.[]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > > [rel#38:Subset#1.NONE.[]] to its parent [rel#42:Subset#1.NONE.[0]] is
> > > > 0.0 (parent importance=0.0, child cost=1.0E30, parent cost=1.0E30)
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > > [rel#38:Subset#1.NONE.[]] to its parent
> > > > [rel#43:Subset#1.ENUMERABLE.[]] is 0.0 (parent importance=0.0, child
> > > > cost=1.0E30, parent cost=1.0E30)
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > > [rel#38:Subset#1.NONE.[]] is 0.0
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > > [rel#43:Subset#1.ENUMERABLE.[]] is 1.0
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > > Rule-match queued: rule [ExpandConversionRule] rels
> > > >
> > > >
> > >
> >
> [rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[])]
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#446
> > > > generated 1 successors: [rel#42:Subset#1.NONE.[0]]
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > > > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 4/2;
> > > > PHASE = OPTIMIZE; COST = {inf}
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > > > rel#43:Subset#1.ENUMERABLE.[]
> > > > Original rel:
> > > > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > > > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > > > 0.0 io}, id = 39
> > > >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> > > > s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> > > > io}, id = 37
> > > >     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> > > > table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> > > > rows, 2.0 cpu, 0.0 io}, id = 33
> > > >
> > > > Sets:
> > > > Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > > >     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.0
> > > >         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> > > > tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> > > > Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > > >     rel#38:Subset#1.NONE.[], best=null, importance=0.5
> > > >
> > > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >
> > > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >     rel#42:Subset#1.NONE.[0], best=null, importance=0.5
> > > >
> > > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >     rel#43:Subset#1.ENUMERABLE.[], best=null, importance=1.0
> > > >
> > > >
> > >
> >
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[]),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >
> > > > Importances: { rel#43:Subset#1.ENUMERABLE.[]=1.0
> > > > rel#38:Subset#1.NONE.[]=0.0 rel#36:Subset#0.ENUMERABLE.[]=0.0}
> > > >
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule
> queue:
> > > > rule [SortRemoveConstantKeysRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.5
> > > > rule [SortProjectTransposeRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > > >
> > > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.5
> > > > rule [PruneSortLimit0] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.5
> > > > rule [ProjectScanRule] rels
> > > >
> > > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> > > > importance 0.5
> > > > rule [ProjectRemoveRule] rels
> > > >
> > > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.5
> > > > rule [EnumerableSortRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.5
> > > > rule [EnumerableProjectRule] rels
> > > >
> > > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.5
> > > > rule [EnumerableLimitRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.5
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> > > > [ExpandConversionRule] rels
> > > >
> > > >
> > >
> >
> [rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[])]
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#550: Apply
> > > > rule [ExpandConversionRule] to
> > > >
> > > >
> > >
> >
> [rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[])]
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#550
> > > > generated 0 successors.
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > > > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 5/3;
> > > > PHASE = OPTIMIZE; COST = {inf}
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > > > rel#43:Subset#1.ENUMERABLE.[]
> > > > Original rel:
> > > > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > > > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > > > 0.0 io}, id = 39
> > > >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> > > > s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> > > > io}, id = 37
> > > >     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> > > > table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> > > > rows, 2.0 cpu, 0.0 io}, id = 33
> > > >
> > > > Sets:
> > > > Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > > >     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.0
> > > >         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> > > > tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> > > > Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > > >     rel#38:Subset#1.NONE.[], best=null, importance=0.5
> > > >
> > > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >
> > > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >     rel#42:Subset#1.NONE.[0], best=null, importance=0.5
> > > >
> > > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >     rel#43:Subset#1.ENUMERABLE.[], best=null, importance=1.0
> > > >
> > > >
> > >
> >
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[]),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >
> > > > Importances: { rel#43:Subset#1.ENUMERABLE.[]=1.0
> > > > rel#38:Subset#1.NONE.[]=0.0 rel#36:Subset#0.ENUMERABLE.[]=0.0}
> > > >
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule
> queue:
> > > > rule [SortProjectTransposeRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > > >
> > > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.5
> > > > rule [PruneSortLimit0] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.5
> > > > rule [ProjectScanRule] rels
> > > >
> > > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> > > > importance 0.5
> > > > rule [ProjectRemoveRule] rels
> > > >
> > > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.5
> > > > rule [EnumerableSortRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.5
> > > > rule [EnumerableProjectRule] rels
> > > >
> > > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.5
> > > > rule [EnumerableLimitRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.5
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> > > > [SortRemoveConstantKeysRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#434: Apply
> > > > rule [SortRemoveConstantKeysRule] to
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#434
> > > > generated 0 successors.
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > > > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 6/4;
> > > > PHASE = OPTIMIZE; COST = {inf}
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > > > rel#43:Subset#1.ENUMERABLE.[]
> > > > Original rel:
> > > > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > > > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > > > 0.0 io}, id = 39
> > > >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> > > > s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> > > > io}, id = 37
> > > >     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> > > > table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> > > > rows, 2.0 cpu, 0.0 io}, id = 33
> > > >
> > > > Sets:
> > > > Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > > >     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.0
> > > >         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> > > > tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> > > > Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > > >     rel#38:Subset#1.NONE.[], best=null, importance=0.5
> > > >
> > > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >
> > > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >     rel#42:Subset#1.NONE.[0], best=null, importance=0.5
> > > >
> > > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >     rel#43:Subset#1.ENUMERABLE.[], best=null, importance=1.0
> > > >
> > > >
> > >
> >
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[]),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >
> > > > Importances: { rel#43:Subset#1.ENUMERABLE.[]=1.0
> > > > rel#38:Subset#1.NONE.[]=0.0 rel#36:Subset#0.ENUMERABLE.[]=0.0}
> > > >
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule
> queue:
> > > > rule [PruneSortLimit0] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.5
> > > > rule [ProjectScanRule] rels
> > > >
> > > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> > > > importance 0.5
> > > > rule [ProjectRemoveRule] rels
> > > >
> > > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.5
> > > > rule [EnumerableSortRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.5
> > > > rule [EnumerableProjectRule] rels
> > > >
> > > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.5
> > > > rule [EnumerableLimitRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.5
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> > > > [SortProjectTransposeRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > > >
> > > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#444: Apply
> > > > rule [SortProjectTransposeRule] to
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > > >
> > > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> LogicalSort#45
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> > > LogicalProject#46
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
> > > > rel#46 via SortProjectTransposeRule with equivalences
> > > > {LogicalSort#45=rel#36:Subset#0.ENUMERABLE.[]}
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - call#444: Rule
> > > > SortProjectTransposeRule arguments
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > > >
> > > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > > created rel#46:LogicalProject
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#47
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
> > > >
> > > >
> > >
> >
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)
> > > > in rel#47:Subset#0.NONE.[0]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > > [rel#36:Subset#0.ENUMERABLE.[]] to its parent
> > > > [rel#38:Subset#1.NONE.[]] is 1.5E-30 (parent importance=0.5, child
> > > > cost=3.0, parent cost=1.0E30)
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > > [rel#36:Subset#0.ENUMERABLE.[]] to its parent
> > > > [rel#47:Subset#0.NONE.[0]] is 0.0 (parent importance=0.0, child
> > > > cost=3.0, parent cost=1.0E30)
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > > [rel#36:Subset#0.ENUMERABLE.[]] is 1.5E-30
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > > [rel#47:Subset#0.NONE.[0]] is 0.0
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > > Rule-match queued: rule [SortRemoveConstantKeysRule] rels
> > > >
> > > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > > Rule-match queued: rule [PruneSortLimit0] rels
> > > >
> > > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > > Rule-match queued: rule [EnumerableSortRule] rels
> > > >
> > > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > > Rule-match queued: rule [SortRemoveRule] rels
> > > >
> > > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > > Rule-match queued: rule [EnumerableLimitRule] rels
> > > >
> > > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> > > LogicalProject#48
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
> > > >
> > > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)
> > > > in rel#42:Subset#1.NONE.[0]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > > [rel#47:Subset#0.NONE.[0]] to its parent [rel#42:Subset#1.NONE.[0]]
> is
> > > > 0.495 (parent importance=0.5, child cost=1.0E30, parent cost=1.0E30)
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > > [rel#47:Subset#0.NONE.[0]] is 0.495
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > > [rel#42:Subset#1.NONE.[0]] is 0.0
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > > Rule-match queued: rule [EnumerableProjectRule] rels
> > > >
> > > >
> > >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > > Rule-match queued: rule [ProjectRemoveRule] rels
> > > >
> > > >
> > >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > > Rule-match queued: rule [SortProjectTransposeRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > > >
> > > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#444
> > > > generated 1 successors: [LogicalProject#46]
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > > > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 7/5;
> > > > PHASE = OPTIMIZE; COST = {inf}
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > > > rel#43:Subset#1.ENUMERABLE.[]
> > > > Original rel:
> > > > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > > > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > > > 0.0 io}, id = 39
> > > >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> > > > s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> > > > io}, id = 37
> > > >     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> > > > table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> > > > rows, 2.0 cpu, 0.0 io}, id = 33
> > > >
> > > > Sets:
> > > > Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > > >     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.2475
> > > >         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> > > > tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> > > >     rel#47:Subset#0.NONE.[0], best=null, importance=0.495
> > > >
> > > >
> > >
> >
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> > > > rowcount=1.0, cumulative cost={inf}
> > > > Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > > >     rel#38:Subset#1.NONE.[], best=null, importance=0.5
> > > >
> > > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >
> > > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >
> > > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >     rel#42:Subset#1.NONE.[0], best=null, importance=0.5
> > > >
> > > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >
> > > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >     rel#43:Subset#1.ENUMERABLE.[], best=null, importance=1.0
> > > >
> > > >
> > >
> >
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[]),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >
> > > > Importances: { rel#43:Subset#1.ENUMERABLE.[]=1.0
> > > > rel#38:Subset#1.NONE.[]=0.0 rel#42:Subset#1.NONE.[0]=0.0
> > > > rel#47:Subset#0.NONE.[0]=0.495 rel#36:Subset#0.ENUMERABLE.[]=1.5E-30}
> > > >
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule
> queue:
> > > > rule [ProjectRemoveRule] rels
> > > >
> > > >
> > >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.5
> > > > rule [EnumerableProjectRule] rels
> > > >
> > > >
> > >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.5
> > > > rule [SortRemoveRule] rels
> > > >
> > > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [SortRemoveConstantKeysRule] rels
> > > >
> > > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [PruneSortLimit0] rels
> > > >
> > > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [EnumerableSortRule] rels
> > > >
> > > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [EnumerableLimitRule] rels
> > > >
> > > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [PruneSortLimit0] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.5
> > > > rule [ProjectScanRule] rels
> > > >
> > > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> > > > importance 0.5
> > > > rule [ProjectRemoveRule] rels
> > > >
> > > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.5
> > > > rule [EnumerableSortRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.5
> > > > rule [EnumerableProjectRule] rels
> > > >
> > > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.5
> > > > rule [EnumerableLimitRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.5
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Skip match: rule
> > > > [SortProjectTransposeRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > > >
> > > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule
> queue:
> > > > rule [EnumerableProjectRule] rels
> > > >
> > > >
> > >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.5
> > > > rule [SortRemoveRule] rels
> > > >
> > > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [SortRemoveConstantKeysRule] rels
> > > >
> > > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [PruneSortLimit0] rels
> > > >
> > > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [EnumerableSortRule] rels
> > > >
> > > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [EnumerableLimitRule] rels
> > > >
> > > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [PruneSortLimit0] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.5
> > > > rule [ProjectScanRule] rels
> > > >
> > > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> > > > importance 0.5
> > > > rule [ProjectRemoveRule] rels
> > > >
> > > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.5
> > > > rule [EnumerableSortRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.5
> > > > rule [EnumerableProjectRule] rels
> > > >
> > > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.5
> > > > rule [EnumerableLimitRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.5
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> > > > [ProjectRemoveRule] rels
> > > >
> > > >
> > >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#617: Apply
> > > > rule [ProjectRemoveRule] to
> > > >
> > > >
> > >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Register #47
> > > > rel#47:Subset#0.NONE.[0], and merge sets
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Merge set#1 into
> > > set#0
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#49
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Rename #39 from
> > > >
> 'LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)'
> > > > to
> > > 'LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)'
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Rename #44 from
> > > >
> > > >
> > >
> >
> 'AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[])'
> > > > to
> > > >
> > >
> >
> 'AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])'
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > > Rule-match queued: rule [SortProjectTransposeRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > > >
> > > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > > Rule-match queued: rule [SortRemoveConstantKeysRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > > Rule-match queued: rule [PruneSortLimit0] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > > Rule-match queued: rule [EnumerableSortRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > > Rule-match queued: rule [SortProjectTransposeRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > > >
> > > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > > Rule-match queued: rule [SortRemoveRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > > Rule-match queued: rule [EnumerableLimitRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > > Rule-match queued: rule [ProjectMergeRule:force_mode] rels
> > > >
> > > >
> > >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > > >
> > > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > > Rule-match queued: rule [ExpandConversionRule] rels
> > > >
> > > >
> > >
> >
> [rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
> > > > rel#47 via ProjectRemoveRule
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - call#617: Rule
> > > > ProjectRemoveRule arguments
> > > >
> > > >
> > >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > > created rel#47:RelSubset
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#617
> > > > generated 1 successors: [rel#47:Subset#0.NONE.[0]]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner -
> > boostImportance(1.0,
> > > > [])
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > > > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 8/6;
> > > > PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > > > rel#36:Subset#0.ENUMERABLE.[]
> > > > Original rel:
> > > > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > > > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > > > 0.0 io}, id = 39
> > > >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> > > > s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> > > > io}, id = 37
> > > >     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> > > > table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> > > > rows, 2.0 cpu, 0.0 io}, id = 33
> > > >
> > > > Sets:
> > > > Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > > >     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.2475
> > > >         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> > > > tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> > > >
> > > >
> > >
> >
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >     rel#47:Subset#0.NONE.[0], best=null, importance=0.495
> > > >
> > > >
> > >
> >
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >
> > > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >
> > > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >     rel#49:Subset#0.NONE.[], best=null, importance=0.2475
> > > >
> > > >
> > >
> >
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >
> > > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >
> > > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >
> > > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >
> > > > Importances: { rel#47:Subset#0.NONE.[0]=0.495
> > > > rel#36:Subset#0.ENUMERABLE.[]=1.5E-30}
> > > >
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule
> queue:
> > > > rule [SortRemoveRule] rels
> > > >
> > > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [SortRemoveRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [SortRemoveConstantKeysRule] rels
> > > >
> > > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [SortRemoveConstantKeysRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [SortProjectTransposeRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > > >
> > > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.495
> > > > rule [SortProjectTransposeRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > > >
> > > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.495
> > > > rule [PruneSortLimit0] rels
> > > >
> > > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [PruneSortLimit0] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [ProjectMergeRule:force_mode] rels
> > > >
> > > >
> > >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > > >
> > > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.495
> > > > rule [EnumerableSortRule] rels
> > > >
> > > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [EnumerableSortRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [EnumerableLimitRule] rels
> > > >
> > > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [EnumerableLimitRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [ExpandConversionRule] rels
> > > >
> > > >
> > >
> >
> [rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
> > > > importance 0.2475
> > > > rule [PruneSortLimit0] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [ProjectScanRule] rels
> > > >
> > > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> > > > importance 0.2475
> > > > rule [ProjectRemoveRule] rels
> > > >
> > > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.2475
> > > > rule [EnumerableSortRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [EnumerableProjectRule] rels
> > > >
> > > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.2475
> > > > rule [EnumerableLimitRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> > > > [EnumerableProjectRule] rels
> > > >
> > > >
> > >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#615: Apply
> > > > rule [EnumerableProjectRule] to
> > > >
> > > >
> > >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#50
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> > > > EnumerableProject#51
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
> > > > rel#51 via EnumerableProjectRule
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - call#615: Rule
> > > > EnumerableProjectRule arguments
> > > >
> > > >
> > >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > > created rel#51:EnumerableProject
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
> > > >
> > > >
> > >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)
> > > > in rel#50:Subset#0.ENUMERABLE.[0]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > > [rel#50:Subset#0.ENUMERABLE.[0]] to its parent
> > > > [rel#50:Subset#0.ENUMERABLE.[0]] is 0.245025 (parent
> > > > importance=0.2475, child cost=1.0E30, parent cost=1.0E30)
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > > [rel#50:Subset#0.ENUMERABLE.[0]] is 0.245025
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > > Rule-match queued: rule [ProjectMergeRule:force_mode] rels
> > > >
> > > >
> > >
> >
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> > > >
> > > >
> > >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > > Rule-match queued: rule [ProjectMergeRule:force_mode] rels
> > > >
> > > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > >
> > > >
> > >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > > Rule-match queued: rule [ProjectRemoveRule] rels
> > > >
> > > >
> > >
> >
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#615
> > > > generated 1 successors:
> > > >
> > > >
> > >
> >
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > > > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 9/7;
> > > > PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > > > rel#36:Subset#0.ENUMERABLE.[]
> > > > Original rel:
> > > > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > > > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > > > 0.0 io}, id = 39
> > > >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> > > > s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> > > > io}, id = 37
> > > >     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> > > > table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> > > > rows, 2.0 cpu, 0.0 io}, id = 33
> > > >
> > > > Sets:
> > > > Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > > >     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.2475
> > > >         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> > > > tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> > > >
> > > >
> > >
> >
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >
> > > >
> > >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >     rel#47:Subset#0.NONE.[0], best=null, importance=0.495
> > > >
> > > >
> > >
> >
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >
> > > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >
> > > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >     rel#49:Subset#0.NONE.[], best=null, importance=0.2475
> > > >
> > > >
> > >
> >
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >
> > > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >
> > > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >
> > > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >     rel#50:Subset#0.ENUMERABLE.[0], best=null, importance=0.2475
> > > >
> > > >
> > >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >
> > > > Importances: { rel#47:Subset#0.NONE.[0]=0.495
> > > > rel#36:Subset#0.ENUMERABLE.[]=1.5E-30
> > > > rel#50:Subset#0.ENUMERABLE.[0]=0.245025}
> > > >
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule
> queue:
> > > > rule [SortRemoveRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [SortRemoveConstantKeysRule] rels
> > > >
> > > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [SortRemoveConstantKeysRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [SortProjectTransposeRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > > >
> > > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.495
> > > > rule [SortProjectTransposeRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > > >
> > > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.495
> > > > rule [PruneSortLimit0] rels
> > > >
> > > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [PruneSortLimit0] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [ProjectMergeRule:force_mode] rels
> > > >
> > > >
> > >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > > >
> > > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.495
> > > > rule [EnumerableSortRule] rels
> > > >
> > > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [EnumerableSortRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [EnumerableLimitRule] rels
> > > >
> > > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [EnumerableLimitRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [ProjectRemoveRule] rels
> > > >
> > > >
> > >
> >
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.2475
> > > > rule [ProjectMergeRule:force_mode] rels
> > > >
> > > >
> > >
> >
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> > > >
> > > >
> > >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.2475
> > > > rule [ProjectMergeRule:force_mode] rels
> > > >
> > > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > >
> > > >
> > >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.2475
> > > > rule [ExpandConversionRule] rels
> > > >
> > > >
> > >
> >
> [rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
> > > > importance 0.2475
> > > > rule [PruneSortLimit0] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [ProjectScanRule] rels
> > > >
> > > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> > > > importance 0.2475
> > > > rule [ProjectRemoveRule] rels
> > > >
> > > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.2475
> > > > rule [EnumerableSortRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [EnumerableProjectRule] rels
> > > >
> > > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.2475
> > > > rule [EnumerableLimitRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> > > > [SortRemoveRule] rels
> > > >
> > > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#571: Apply
> > > > rule [SortRemoveRule] to
> > > >
> > > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
> > > > rel#50 via SortRemoveRule
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - call#571: Rule
> > > > SortRemoveRule arguments
> > > >
> > > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > > created rel#50:RelSubset
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#571
> > > > generated 1 successors: [rel#50:Subset#0.ENUMERABLE.[0]]
> > > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > > > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK =
> 10/8;
> > > > PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > > > rel#36:Subset#0.ENUMERABLE.[]
> > > > Original rel:
> > > > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > > > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > > > 0.0 io}, id = 39
> > > >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> > > > s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> > > > io}, id = 37
> > > >     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> > > > table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> > > > rows, 2.0 cpu, 0.0 io}, id = 33
> > > >
> > > > Sets:
> > > > Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > > >     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.2475
> > > >         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> > > > tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> > > >
> > > >
> > >
> >
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >
> > > >
> > >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >     rel#47:Subset#0.NONE.[0], best=null, importance=0.495
> > > >
> > > >
> > >
> >
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >
> > > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >
> > > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >     rel#49:Subset#0.NONE.[], best=null, importance=0.2475
> > > >
> > > >
> > >
> >
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >
> > > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >
> > > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >
> > > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >     rel#50:Subset#0.ENUMERABLE.[0], best=null, importance=0.2475
> > > >
> > > >
> > >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> > > > rowcount=1.0, cumulative cost={inf}
> > > >
> > > > Importances: { rel#47:Subset#0.NONE.[0]=0.495
> > > > rel#36:Subset#0.ENUMERABLE.[]=1.5E-30
> > > > rel#50:Subset#0.ENUMERABLE.[0]=0.245025}
> > > >
> > > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule
> queue:
> > > > rule [SortRemoveConstantKeysRule] rels
> > > >
> > > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [SortRemoveConstantKeysRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [SortProjectTransposeRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > > >
> > > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.495
> > > > rule [SortProjectTransposeRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > > >
> > > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.495
> > > > rule [PruneSortLimit0] rels
> > > >
> > > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [PruneSortLimit0] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [ProjectMergeRule:force_mode] rels
> > > >
> > > >
> > >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > > >
> > > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > > importance 0.495
> > > > rule [EnumerableSortRule] rels
> > > >
> > > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [EnumerableSortRule] rels
> > > >
> > > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > > importance 0.495
> > > > rule [EnumerableLimitRule] rels
> > > >
> > > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > >

-- 


-- Enrico Olivelli

Re: Help with EnumerableMergeJoinRule which is losing a RelCollection trait

Posted by Stamatis Zampetakis <za...@gmail.com>.
Have a look in CalcitePrepareImpl (
https://github.com/apache/calcite/blob/3a4fba828f3d9e48749fadd22f134891612b7072/core/src/main/java/org/apache/calcite/prepare/CalcitePrepareImpl.java#L1109
)

Possibly you need a few lines like below:

final RelCollation collation =
          rel instanceof Sort
              ? ((Sort) rel).collation
              : RelCollations.EMPTY;



Στις Παρ, 28 Σεπ 2018 στις 11:39 μ.μ., ο/η Enrico Olivelli <
eolivelli@gmail.com> έγραψε:

> Il ven 28 set 2018, 23:00 Stamatis Zampetakis <za...@gmail.com> ha
> scritto:
>
> > Hi Enrico,
> >
> > I didn't look thoroughly but I suspect that maybe the problem is when you
> > set the desiredTraits (
> >
> >
> https://github.com/diennea/herddb/blob/0c7c01584350d57d8102511b987e5f880f3f65bd/herddb-core/src/main/java/herddb/sql/CalcitePlanner.java#L449
> > ).
> > Apart from the EnumerableConvention, I think you should also set the
> > expected RelCollationTrait. Can you check what are the desiredTraits that
> > you are passing to the optimizer?
> >
>
> Stamatis
> You see correctly that I am passing only EnumerableConvention as
> desiredTraits.
> I can't find the 'Trait' for RelCollation, there is no constant
> like EnumerableConvention.
> Is there anya special way to instantiate it?
> I can't find and examplethe in Calcite tests
>
> Thank you so much
> Enrico
>
>
>
> > Best,
> > Stamatis
> >
> > Στις Παρ, 28 Σεπ 2018 στις 9:58 μ.μ., ο/η Enrico Olivelli <
> > eolivelli@gmail.com> έγραψε:
> >
> > > Sorry  in advance for this very long email....
> > > I am trying to debug, but I honestly I did not undestand clearly how
> > > these rules work
> > >
> > > I have this query:
> > > SELECT `tsql`.`k1`, `tsql`.`n1`, `tsql`.`s1`
> > > FROM `tblspace1`.`tsql` AS `TSQL`
> > >
> > > This is the table:
> > > CREATE TABLE tblspace1.tsql (k1 string primary key,n1 int,s1 string)
> > >
> > > Logical Plan Starts with:
> > > LogicalSort(sort0=[$0], dir0=[ASC])
> > >   LogicalProject(k1=[$0], n1=[$1], s1=[$2])
> > >     LogicalTableScan(table=[[tblspace1, tsql]])
> > >
> > > And the Best Exp eventually is:
> > > EnumerableTableScan(table=[[tblspace1, tsql]]): rowcount = 1.0,
> > > cumulative cost = {1.0 rows, 2.0 cpu, 0.0 io}, id = 33
> > >
> > > The problem is that the Sort disappears.
> > > The Table is configured with Statistics without any Collation
> > > Statistics.of(tableManager.getStats().getTablesize(), keys)
> > >
> > > This happens if I enable these traits on the Planner:
> > > ConventionTraitDef.INSTANCE, RelCollationTraitDef.INSTANCE
> > >
> > > if I enable only ConventionTraitDef the sort does not disappear
> > >
> > > These are "TRACE" level logs of the Planner
> > >
> > > Maybe some expert of you can see inside the logs the anwer to my
> problem.
> > >
> > > Thank you in advace, I know that your time is valuable. I appreciate
> > > any kind of help
> > >
> > > Enrico
> > >
> > >
> > > [main] TRACE org.apache.calcite.sql.parser - After validation: SELECT
> > > `tsql`.`k1`, `tsql`.`n1`, `tsql`.`s1`
> > > FROM `tblspace1`.`tsql` AS `TSQL`
> > > ORDER BY `K1`
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> > > LogicalTableScan#30
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> > LogicalProject#31
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new LogicalSort#32
> > > [main] DEBUG org.apache.calcite.sql2rel - Plan after converting
> > > SqlNode to RelNode
> > > LogicalSort(sort0=[$0], dir0=[ASC])
> > >   LogicalProject(k1=[$0], n1=[$1], s1=[$2])
> > >     LogicalTableScan(table=[[tblspace1, tsql]])
> > >
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> > > EnumerableTableScan#33
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> > LogicalProject#34
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new LogicalSort#35
> > > Query: select * from tblspace1.tsql order by k1
> > > -- Best  Plan
> > > LogicalSort(sort0=[$0], dir0=[ASC]): rowcount = 1.0, cumulative cost =
> > > {3.0 rows, 17.0 cpu, 0.0 io}, id = 35
> > >   LogicalProject(k1=[$0], n1=[$1], s1=[$2]): rowcount = 1.0,
> > > cumulative cost = {2.0 rows, 5.0 cpu, 0.0 io}, id = 34
> > >     EnumerableTableScan(table=[[tblspace1, tsql]]): rowcount = 1.0,
> > > cumulative cost = {1.0 rows, 2.0 cpu, 0.0 io}, id = 33
> > >
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#36
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Subset cost
> > > improved: subset [rel#36:Subset#0.ENUMERABLE.[]] cost was {inf} now
> > > {1.0 rows, 2.0 cpu, 0.0 io}
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
> > > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql]) in
> > > rel#36:Subset#0.ENUMERABLE.[]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > [rel#36:Subset#0.ENUMERABLE.[]] is 0.0
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> > LogicalProject#37
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#38
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
> > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)
> > > in rel#38:Subset#1.NONE.[]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > [rel#36:Subset#0.ENUMERABLE.[]] to its parent
> > > [rel#38:Subset#1.NONE.[]] is 0.0 (parent importance=0.0, child
> > > cost=3.0, parent cost=1.0E30)
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > [rel#36:Subset#0.ENUMERABLE.[]] is 0.0
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > [rel#38:Subset#1.NONE.[]] is 0.0
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > Rule-match queued: rule [EnumerableProjectRule] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > Rule-match queued: rule [ProjectRemoveRule] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > Rule-match queued: rule [ProjectScanRule] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new LogicalSort#39
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#40
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
> > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)
> > > in rel#40:Subset#2.NONE.[0]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > [rel#38:Subset#1.NONE.[]] to its parent [rel#40:Subset#2.NONE.[0]] is
> > > 0.0 (parent importance=0.0, child cost=1.0E30, parent cost=1.0E30)
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > [rel#38:Subset#1.NONE.[]] is 0.0
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > [rel#40:Subset#2.NONE.[0]] is 0.0
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > Rule-match queued: rule [SortRemoveConstantKeysRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > Rule-match queued: rule [PruneSortLimit0] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > Rule-match queued: rule [EnumerableSortRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > Rule-match queued: rule [SortProjectTransposeRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > Rule-match queued: rule [SortRemoveRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > Rule-match queued: rule [EnumerableLimitRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#41
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 1/1;
> > > PHASE = PRE_PROCESS_MDR; COST = {inf}
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > > rel#41:Subset#2.ENUMERABLE.[]
> > > Original rel:
> > > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > > 0.0 io}, id = 39
> > >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> > > s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> > > io}, id = 37
> > >     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> > > table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> > > rows, 2.0 cpu, 0.0 io}, id = 33
> > >
> > > Sets:
> > > Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > >     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.0
> > >         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> > > tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> > > Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > >     rel#38:Subset#1.NONE.[], best=null, importance=0.0
> > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > rowcount=1.0, cumulative cost={inf}
> > > Set#2, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > >     rel#40:Subset#2.NONE.[0], best=null, importance=0.0
> > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > > rowcount=1.0, cumulative cost={inf}
> > >     rel#41:Subset#2.ENUMERABLE.[], best=null, importance=0.0
> > >
> > > Importances: { rel#36:Subset#0.ENUMERABLE.[]=0.0
> > > rel#38:Subset#1.NONE.[]=0.0 rel#40:Subset#2.NONE.[0]=0.0}
> > >
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 2/1;
> > > PHASE = PRE_PROCESS; COST = {inf}
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > > rel#41:Subset#2.ENUMERABLE.[]
> > > Original rel:
> > > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > > 0.0 io}, id = 39
> > >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> > > s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> > > io}, id = 37
> > >     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> > > table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> > > rows, 2.0 cpu, 0.0 io}, id = 33
> > >
> > > Sets:
> > > Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > >     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.0
> > >         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> > > tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> > > Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > >     rel#38:Subset#1.NONE.[], best=null, importance=0.0
> > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > rowcount=1.0, cumulative cost={inf}
> > > Set#2, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > >     rel#40:Subset#2.NONE.[0], best=null, importance=0.0
> > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > > rowcount=1.0, cumulative cost={inf}
> > >     rel#41:Subset#2.ENUMERABLE.[], best=null, importance=0.0
> > >
> > > Importances: { rel#36:Subset#0.ENUMERABLE.[]=0.0
> > > rel#38:Subset#1.NONE.[]=0.0 rel#40:Subset#2.NONE.[0]=0.0}
> > >
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 3/1;
> > > PHASE = OPTIMIZE; COST = {inf}
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > > rel#41:Subset#2.ENUMERABLE.[]
> > > Original rel:
> > > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > > 0.0 io}, id = 39
> > >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> > > s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> > > io}, id = 37
> > >     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> > > table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> > > rows, 2.0 cpu, 0.0 io}, id = 33
> > >
> > > Sets:
> > > Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > >     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.0
> > >         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> > > tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> > > Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > >     rel#38:Subset#1.NONE.[], best=null, importance=0.0
> > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > rowcount=1.0, cumulative cost={inf}
> > > Set#2, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > >     rel#40:Subset#2.NONE.[0], best=null, importance=0.0
> > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > > rowcount=1.0, cumulative cost={inf}
> > >     rel#41:Subset#2.ENUMERABLE.[], best=null, importance=0.0
> > >
> > > Importances: { rel#36:Subset#0.ENUMERABLE.[]=0.0
> > > rel#38:Subset#1.NONE.[]=0.0 rel#40:Subset#2.NONE.[0]=0.0}
> > >
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> > > rule [SortRemoveConstantKeysRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.0
> > > rule [SortProjectTransposeRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > importance 0.0
> > > rule [PruneSortLimit0] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.0
> > > rule [ProjectScanRule] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> > > importance 0.0
> > > rule [ProjectRemoveRule] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > importance 0.0
> > > rule [EnumerableSortRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.0
> > > rule [EnumerableProjectRule] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > importance 0.0
> > > rule [EnumerableLimitRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.0
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> > > [SortRemoveRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#446: Apply
> > > rule [SortRemoveRule] to
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#42
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
> > > rel#42 via SortRemoveRule
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - call#446: Rule
> > > SortRemoveRule arguments
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > created rel#42:RelSubset
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Merge set#2 into
> > set#1
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#43
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> > > AbstractConverter#44
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
> > >
> > >
> >
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[])
> > > in rel#43:Subset#1.ENUMERABLE.[]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > [rel#38:Subset#1.NONE.[]] to its parent [rel#42:Subset#1.NONE.[0]] is
> > > 0.0 (parent importance=0.0, child cost=1.0E30, parent cost=1.0E30)
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > [rel#38:Subset#1.NONE.[]] to its parent
> > > [rel#43:Subset#1.ENUMERABLE.[]] is 0.0 (parent importance=0.0, child
> > > cost=1.0E30, parent cost=1.0E30)
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > [rel#38:Subset#1.NONE.[]] is 0.0
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > [rel#43:Subset#1.ENUMERABLE.[]] is 1.0
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > Rule-match queued: rule [ExpandConversionRule] rels
> > >
> > >
> >
> [rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[])]
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#446
> > > generated 1 successors: [rel#42:Subset#1.NONE.[0]]
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 4/2;
> > > PHASE = OPTIMIZE; COST = {inf}
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > > rel#43:Subset#1.ENUMERABLE.[]
> > > Original rel:
> > > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > > 0.0 io}, id = 39
> > >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> > > s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> > > io}, id = 37
> > >     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> > > table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> > > rows, 2.0 cpu, 0.0 io}, id = 33
> > >
> > > Sets:
> > > Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > >     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.0
> > >         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> > > tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> > > Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > >     rel#38:Subset#1.NONE.[], best=null, importance=0.5
> > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > > rowcount=1.0, cumulative cost={inf}
> > >     rel#42:Subset#1.NONE.[0], best=null, importance=0.5
> > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > > rowcount=1.0, cumulative cost={inf}
> > >     rel#43:Subset#1.ENUMERABLE.[], best=null, importance=1.0
> > >
> > >
> >
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[]),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > > Importances: { rel#43:Subset#1.ENUMERABLE.[]=1.0
> > > rel#38:Subset#1.NONE.[]=0.0 rel#36:Subset#0.ENUMERABLE.[]=0.0}
> > >
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> > > rule [SortRemoveConstantKeysRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.5
> > > rule [SortProjectTransposeRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > importance 0.5
> > > rule [PruneSortLimit0] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.5
> > > rule [ProjectScanRule] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> > > importance 0.5
> > > rule [ProjectRemoveRule] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > importance 0.5
> > > rule [EnumerableSortRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.5
> > > rule [EnumerableProjectRule] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > importance 0.5
> > > rule [EnumerableLimitRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.5
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> > > [ExpandConversionRule] rels
> > >
> > >
> >
> [rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[])]
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#550: Apply
> > > rule [ExpandConversionRule] to
> > >
> > >
> >
> [rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[])]
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#550
> > > generated 0 successors.
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 5/3;
> > > PHASE = OPTIMIZE; COST = {inf}
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > > rel#43:Subset#1.ENUMERABLE.[]
> > > Original rel:
> > > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > > 0.0 io}, id = 39
> > >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> > > s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> > > io}, id = 37
> > >     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> > > table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> > > rows, 2.0 cpu, 0.0 io}, id = 33
> > >
> > > Sets:
> > > Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > >     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.0
> > >         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> > > tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> > > Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > >     rel#38:Subset#1.NONE.[], best=null, importance=0.5
> > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > > rowcount=1.0, cumulative cost={inf}
> > >     rel#42:Subset#1.NONE.[0], best=null, importance=0.5
> > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > > rowcount=1.0, cumulative cost={inf}
> > >     rel#43:Subset#1.ENUMERABLE.[], best=null, importance=1.0
> > >
> > >
> >
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[]),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > > Importances: { rel#43:Subset#1.ENUMERABLE.[]=1.0
> > > rel#38:Subset#1.NONE.[]=0.0 rel#36:Subset#0.ENUMERABLE.[]=0.0}
> > >
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> > > rule [SortProjectTransposeRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > importance 0.5
> > > rule [PruneSortLimit0] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.5
> > > rule [ProjectScanRule] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> > > importance 0.5
> > > rule [ProjectRemoveRule] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > importance 0.5
> > > rule [EnumerableSortRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.5
> > > rule [EnumerableProjectRule] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > importance 0.5
> > > rule [EnumerableLimitRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.5
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> > > [SortRemoveConstantKeysRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#434: Apply
> > > rule [SortRemoveConstantKeysRule] to
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#434
> > > generated 0 successors.
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 6/4;
> > > PHASE = OPTIMIZE; COST = {inf}
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > > rel#43:Subset#1.ENUMERABLE.[]
> > > Original rel:
> > > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > > 0.0 io}, id = 39
> > >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> > > s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> > > io}, id = 37
> > >     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> > > table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> > > rows, 2.0 cpu, 0.0 io}, id = 33
> > >
> > > Sets:
> > > Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > >     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.0
> > >         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> > > tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> > > Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > >     rel#38:Subset#1.NONE.[], best=null, importance=0.5
> > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > > rowcount=1.0, cumulative cost={inf}
> > >     rel#42:Subset#1.NONE.[0], best=null, importance=0.5
> > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > > rowcount=1.0, cumulative cost={inf}
> > >     rel#43:Subset#1.ENUMERABLE.[], best=null, importance=1.0
> > >
> > >
> >
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[]),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > > Importances: { rel#43:Subset#1.ENUMERABLE.[]=1.0
> > > rel#38:Subset#1.NONE.[]=0.0 rel#36:Subset#0.ENUMERABLE.[]=0.0}
> > >
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> > > rule [PruneSortLimit0] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.5
> > > rule [ProjectScanRule] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> > > importance 0.5
> > > rule [ProjectRemoveRule] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > importance 0.5
> > > rule [EnumerableSortRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.5
> > > rule [EnumerableProjectRule] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > importance 0.5
> > > rule [EnumerableLimitRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.5
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> > > [SortProjectTransposeRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#444: Apply
> > > rule [SortProjectTransposeRule] to
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new LogicalSort#45
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> > LogicalProject#46
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
> > > rel#46 via SortProjectTransposeRule with equivalences
> > > {LogicalSort#45=rel#36:Subset#0.ENUMERABLE.[]}
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - call#444: Rule
> > > SortProjectTransposeRule arguments
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > created rel#46:LogicalProject
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#47
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
> > >
> > >
> >
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)
> > > in rel#47:Subset#0.NONE.[0]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > [rel#36:Subset#0.ENUMERABLE.[]] to its parent
> > > [rel#38:Subset#1.NONE.[]] is 1.5E-30 (parent importance=0.5, child
> > > cost=3.0, parent cost=1.0E30)
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > [rel#36:Subset#0.ENUMERABLE.[]] to its parent
> > > [rel#47:Subset#0.NONE.[0]] is 0.0 (parent importance=0.0, child
> > > cost=3.0, parent cost=1.0E30)
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > [rel#36:Subset#0.ENUMERABLE.[]] is 1.5E-30
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > [rel#47:Subset#0.NONE.[0]] is 0.0
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > Rule-match queued: rule [SortRemoveConstantKeysRule] rels
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > Rule-match queued: rule [PruneSortLimit0] rels
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > Rule-match queued: rule [EnumerableSortRule] rels
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > Rule-match queued: rule [SortRemoveRule] rels
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > Rule-match queued: rule [EnumerableLimitRule] rels
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> > LogicalProject#48
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
> > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)
> > > in rel#42:Subset#1.NONE.[0]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > [rel#47:Subset#0.NONE.[0]] to its parent [rel#42:Subset#1.NONE.[0]] is
> > > 0.495 (parent importance=0.5, child cost=1.0E30, parent cost=1.0E30)
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > [rel#47:Subset#0.NONE.[0]] is 0.495
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > [rel#42:Subset#1.NONE.[0]] is 0.0
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > Rule-match queued: rule [EnumerableProjectRule] rels
> > >
> > >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > Rule-match queued: rule [ProjectRemoveRule] rels
> > >
> > >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > Rule-match queued: rule [SortProjectTransposeRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#444
> > > generated 1 successors: [LogicalProject#46]
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 7/5;
> > > PHASE = OPTIMIZE; COST = {inf}
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > > rel#43:Subset#1.ENUMERABLE.[]
> > > Original rel:
> > > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > > 0.0 io}, id = 39
> > >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> > > s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> > > io}, id = 37
> > >     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> > > table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> > > rows, 2.0 cpu, 0.0 io}, id = 33
> > >
> > > Sets:
> > > Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > >     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.2475
> > >         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> > > tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> > >     rel#47:Subset#0.NONE.[0], best=null, importance=0.495
> > >
> > >
> >
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> > > rowcount=1.0, cumulative cost={inf}
> > > Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > >     rel#38:Subset#1.NONE.[], best=null, importance=0.5
> > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > > rowcount=1.0, cumulative cost={inf}
> > >     rel#42:Subset#1.NONE.[0], best=null, importance=0.5
> > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > > rowcount=1.0, cumulative cost={inf}
> > >     rel#43:Subset#1.ENUMERABLE.[], best=null, importance=1.0
> > >
> > >
> >
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[]),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > > Importances: { rel#43:Subset#1.ENUMERABLE.[]=1.0
> > > rel#38:Subset#1.NONE.[]=0.0 rel#42:Subset#1.NONE.[0]=0.0
> > > rel#47:Subset#0.NONE.[0]=0.495 rel#36:Subset#0.ENUMERABLE.[]=1.5E-30}
> > >
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> > > rule [ProjectRemoveRule] rels
> > >
> > >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > importance 0.5
> > > rule [EnumerableProjectRule] rels
> > >
> > >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > importance 0.5
> > > rule [SortRemoveRule] rels
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [SortRemoveConstantKeysRule] rels
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [PruneSortLimit0] rels
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [EnumerableSortRule] rels
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [EnumerableLimitRule] rels
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [PruneSortLimit0] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.5
> > > rule [ProjectScanRule] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> > > importance 0.5
> > > rule [ProjectRemoveRule] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > importance 0.5
> > > rule [EnumerableSortRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.5
> > > rule [EnumerableProjectRule] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > importance 0.5
> > > rule [EnumerableLimitRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.5
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Skip match: rule
> > > [SortProjectTransposeRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> > > rule [EnumerableProjectRule] rels
> > >
> > >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > importance 0.5
> > > rule [SortRemoveRule] rels
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [SortRemoveConstantKeysRule] rels
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [PruneSortLimit0] rels
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [EnumerableSortRule] rels
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [EnumerableLimitRule] rels
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [PruneSortLimit0] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.5
> > > rule [ProjectScanRule] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> > > importance 0.5
> > > rule [ProjectRemoveRule] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > importance 0.5
> > > rule [EnumerableSortRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.5
> > > rule [EnumerableProjectRule] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > importance 0.5
> > > rule [EnumerableLimitRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.5
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> > > [ProjectRemoveRule] rels
> > >
> > >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#617: Apply
> > > rule [ProjectRemoveRule] to
> > >
> > >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Register #47
> > > rel#47:Subset#0.NONE.[0], and merge sets
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Merge set#1 into
> > set#0
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#49
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Rename #39 from
> > > 'LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)'
> > > to
> > 'LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)'
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Rename #44 from
> > >
> > >
> >
> 'AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[])'
> > > to
> > >
> >
> 'AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])'
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > Rule-match queued: rule [SortProjectTransposeRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > Rule-match queued: rule [SortRemoveConstantKeysRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > Rule-match queued: rule [PruneSortLimit0] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > Rule-match queued: rule [EnumerableSortRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > Rule-match queued: rule [SortProjectTransposeRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > Rule-match queued: rule [SortRemoveRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > Rule-match queued: rule [EnumerableLimitRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > Rule-match queued: rule [ProjectMergeRule:force_mode] rels
> > >
> > >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > Rule-match queued: rule [ExpandConversionRule] rels
> > >
> > >
> >
> [rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
> > > rel#47 via ProjectRemoveRule
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - call#617: Rule
> > > ProjectRemoveRule arguments
> > >
> > >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > created rel#47:RelSubset
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#617
> > > generated 1 successors: [rel#47:Subset#0.NONE.[0]]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner -
> boostImportance(1.0,
> > > [])
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 8/6;
> > > PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > > rel#36:Subset#0.ENUMERABLE.[]
> > > Original rel:
> > > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > > 0.0 io}, id = 39
> > >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> > > s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> > > io}, id = 37
> > >     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> > > table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> > > rows, 2.0 cpu, 0.0 io}, id = 33
> > >
> > > Sets:
> > > Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > >     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.2475
> > >         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> > > tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> > >
> > >
> >
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
> > > rowcount=1.0, cumulative cost={inf}
> > >     rel#47:Subset#0.NONE.[0], best=null, importance=0.495
> > >
> > >
> >
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > > rowcount=1.0, cumulative cost={inf}
> > >     rel#49:Subset#0.NONE.[], best=null, importance=0.2475
> > >
> > >
> >
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > > Importances: { rel#47:Subset#0.NONE.[0]=0.495
> > > rel#36:Subset#0.ENUMERABLE.[]=1.5E-30}
> > >
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> > > rule [SortRemoveRule] rels
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [SortRemoveRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [SortRemoveConstantKeysRule] rels
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [SortRemoveConstantKeysRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [SortProjectTransposeRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > importance 0.495
> > > rule [SortProjectTransposeRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > importance 0.495
> > > rule [PruneSortLimit0] rels
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [PruneSortLimit0] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [ProjectMergeRule:force_mode] rels
> > >
> > >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > importance 0.495
> > > rule [EnumerableSortRule] rels
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [EnumerableSortRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [EnumerableLimitRule] rels
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [EnumerableLimitRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [ExpandConversionRule] rels
> > >
> > >
> >
> [rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
> > > importance 0.2475
> > > rule [PruneSortLimit0] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [ProjectScanRule] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> > > importance 0.2475
> > > rule [ProjectRemoveRule] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > importance 0.2475
> > > rule [EnumerableSortRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [EnumerableProjectRule] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > importance 0.2475
> > > rule [EnumerableLimitRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> > > [EnumerableProjectRule] rels
> > >
> > >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#615: Apply
> > > rule [EnumerableProjectRule] to
> > >
> > >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#50
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> > > EnumerableProject#51
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
> > > rel#51 via EnumerableProjectRule
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - call#615: Rule
> > > EnumerableProjectRule arguments
> > >
> > >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > created rel#51:EnumerableProject
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
> > >
> > >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)
> > > in rel#50:Subset#0.ENUMERABLE.[0]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > [rel#50:Subset#0.ENUMERABLE.[0]] to its parent
> > > [rel#50:Subset#0.ENUMERABLE.[0]] is 0.245025 (parent
> > > importance=0.2475, child cost=1.0E30, parent cost=1.0E30)
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > > [rel#50:Subset#0.ENUMERABLE.[0]] is 0.245025
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > Rule-match queued: rule [ProjectMergeRule:force_mode] rels
> > >
> > >
> >
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> > >
> > >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > Rule-match queued: rule [ProjectMergeRule:force_mode] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > >
> > >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > > Rule-match queued: rule [ProjectRemoveRule] rels
> > >
> > >
> >
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#615
> > > generated 1 successors:
> > >
> > >
> >
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 9/7;
> > > PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > > rel#36:Subset#0.ENUMERABLE.[]
> > > Original rel:
> > > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > > 0.0 io}, id = 39
> > >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> > > s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> > > io}, id = 37
> > >     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> > > table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> > > rows, 2.0 cpu, 0.0 io}, id = 33
> > >
> > > Sets:
> > > Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > >     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.2475
> > >         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> > > tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> > >
> > >
> >
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> > > rowcount=1.0, cumulative cost={inf}
> > >     rel#47:Subset#0.NONE.[0], best=null, importance=0.495
> > >
> > >
> >
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > > rowcount=1.0, cumulative cost={inf}
> > >     rel#49:Subset#0.NONE.[], best=null, importance=0.2475
> > >
> > >
> >
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > > rowcount=1.0, cumulative cost={inf}
> > >     rel#50:Subset#0.ENUMERABLE.[0], best=null, importance=0.2475
> > >
> > >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > > Importances: { rel#47:Subset#0.NONE.[0]=0.495
> > > rel#36:Subset#0.ENUMERABLE.[]=1.5E-30
> > > rel#50:Subset#0.ENUMERABLE.[0]=0.245025}
> > >
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> > > rule [SortRemoveRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [SortRemoveConstantKeysRule] rels
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [SortRemoveConstantKeysRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [SortProjectTransposeRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > importance 0.495
> > > rule [SortProjectTransposeRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > importance 0.495
> > > rule [PruneSortLimit0] rels
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [PruneSortLimit0] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [ProjectMergeRule:force_mode] rels
> > >
> > >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > importance 0.495
> > > rule [EnumerableSortRule] rels
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [EnumerableSortRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [EnumerableLimitRule] rels
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [EnumerableLimitRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [ProjectRemoveRule] rels
> > >
> > >
> >
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > > importance 0.2475
> > > rule [ProjectMergeRule:force_mode] rels
> > >
> > >
> >
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> > >
> > >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > > importance 0.2475
> > > rule [ProjectMergeRule:force_mode] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > >
> > >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > > importance 0.2475
> > > rule [ExpandConversionRule] rels
> > >
> > >
> >
> [rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
> > > importance 0.2475
> > > rule [PruneSortLimit0] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [ProjectScanRule] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> > > importance 0.2475
> > > rule [ProjectRemoveRule] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > importance 0.2475
> > > rule [EnumerableSortRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [EnumerableProjectRule] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > importance 0.2475
> > > rule [EnumerableLimitRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> > > [SortRemoveRule] rels
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#571: Apply
> > > rule [SortRemoveRule] to
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
> > > rel#50 via SortRemoveRule
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - call#571: Rule
> > > SortRemoveRule arguments
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > created rel#50:RelSubset
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#571
> > > generated 1 successors: [rel#50:Subset#0.ENUMERABLE.[0]]
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 10/8;
> > > PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > > rel#36:Subset#0.ENUMERABLE.[]
> > > Original rel:
> > > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > > 0.0 io}, id = 39
> > >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> > > s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> > > io}, id = 37
> > >     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> > > table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> > > rows, 2.0 cpu, 0.0 io}, id = 33
> > >
> > > Sets:
> > > Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > >     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.2475
> > >         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> > > tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> > >
> > >
> >
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> > > rowcount=1.0, cumulative cost={inf}
> > >     rel#47:Subset#0.NONE.[0], best=null, importance=0.495
> > >
> > >
> >
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > > rowcount=1.0, cumulative cost={inf}
> > >     rel#49:Subset#0.NONE.[], best=null, importance=0.2475
> > >
> > >
> >
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > > rowcount=1.0, cumulative cost={inf}
> > >     rel#50:Subset#0.ENUMERABLE.[0], best=null, importance=0.2475
> > >
> > >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > > Importances: { rel#47:Subset#0.NONE.[0]=0.495
> > > rel#36:Subset#0.ENUMERABLE.[]=1.5E-30
> > > rel#50:Subset#0.ENUMERABLE.[0]=0.245025}
> > >
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> > > rule [SortRemoveConstantKeysRule] rels
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [SortRemoveConstantKeysRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [SortProjectTransposeRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > importance 0.495
> > > rule [SortProjectTransposeRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > importance 0.495
> > > rule [PruneSortLimit0] rels
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [PruneSortLimit0] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [ProjectMergeRule:force_mode] rels
> > >
> > >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > importance 0.495
> > > rule [EnumerableSortRule] rels
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [EnumerableSortRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [EnumerableLimitRule] rels
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [EnumerableLimitRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [ProjectRemoveRule] rels
> > >
> > >
> >
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > > importance 0.2475
> > > rule [ProjectMergeRule:force_mode] rels
> > >
> > >
> >
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> > >
> > >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > > importance 0.2475
> > > rule [ProjectMergeRule:force_mode] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > >
> > >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > > importance 0.2475
> > > rule [ExpandConversionRule] rels
> > >
> > >
> >
> [rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
> > > importance 0.2475
> > > rule [PruneSortLimit0] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [ProjectScanRule] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> > > importance 0.2475
> > > rule [ProjectRemoveRule] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > importance 0.2475
> > > rule [EnumerableSortRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [EnumerableProjectRule] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > importance 0.2475
> > > rule [EnumerableLimitRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> > > [SortRemoveRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#737: Apply
> > > rule [SortRemoveRule] to
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
> > > rel#47 via SortRemoveRule
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - call#737: Rule
> > > SortRemoveRule arguments
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > created rel#47:RelSubset
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#737
> > > generated 1 successors: [rel#47:Subset#0.NONE.[0]]
> > > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 11/9;
> > > PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > > rel#36:Subset#0.ENUMERABLE.[]
> > > Original rel:
> > > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > > 0.0 io}, id = 39
> > >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> > > s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> > > io}, id = 37
> > >     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> > > table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> > > rows, 2.0 cpu, 0.0 io}, id = 33
> > >
> > > Sets:
> > > Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> > >     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.2475
> > >         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> > > tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> > >
> > >
> >
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> > > rowcount=1.0, cumulative cost={inf}
> > >     rel#47:Subset#0.NONE.[0], best=null, importance=0.495
> > >
> > >
> >
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > > rowcount=1.0, cumulative cost={inf}
> > >     rel#49:Subset#0.NONE.[], best=null, importance=0.2475
> > >
> > >
> >
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > > rowcount=1.0, cumulative cost={inf}
> > >     rel#50:Subset#0.ENUMERABLE.[0], best=null, importance=0.2475
> > >
> > >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> > > rowcount=1.0, cumulative cost={inf}
> > >
> > > Importances: { rel#47:Subset#0.NONE.[0]=0.495
> > > rel#36:Subset#0.ENUMERABLE.[]=1.5E-30
> > > rel#50:Subset#0.ENUMERABLE.[0]=0.245025}
> > >
> > > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> > > rule [SortRemoveConstantKeysRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [SortProjectTransposeRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > importance 0.495
> > > rule [SortProjectTransposeRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > >
> > >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > > importance 0.495
> > > rule [PruneSortLimit0] rels
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [PruneSortLimit0] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [ProjectMergeRule:force_mode] rels
> > >
> > >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > >
> > >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > > importance 0.495
> > > rule [EnumerableSortRule] rels
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [EnumerableSortRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [EnumerableLimitRule] rels
> > >
> > >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [EnumerableLimitRule] rels
> > >
> > >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > > importance 0.495
> > > rule [ProjectRemoveRule] rels
> > >
> > >
> >
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > > importance 0.2475
> > > rule [ProjectMergeRule:force_mode] rels
> > >
> > >
> >
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> > >
> > >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > > importance 0.2475
> > > rule [ProjectMergeRule:force_mode] rels
> > >
> > >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > >
> > >
> > rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUME

Re: Help with EnumerableMergeJoinRule which is losing a RelCollection trait

Posted by Enrico Olivelli <eo...@gmail.com>.
Il ven 28 set 2018, 23:00 Stamatis Zampetakis <za...@gmail.com> ha
scritto:

> Hi Enrico,
>
> I didn't look thoroughly but I suspect that maybe the problem is when you
> set the desiredTraits (
>
> https://github.com/diennea/herddb/blob/0c7c01584350d57d8102511b987e5f880f3f65bd/herddb-core/src/main/java/herddb/sql/CalcitePlanner.java#L449
> ).
> Apart from the EnumerableConvention, I think you should also set the
> expected RelCollationTrait. Can you check what are the desiredTraits that
> you are passing to the optimizer?
>

Stamatis
You see correctly that I am passing only EnumerableConvention as
desiredTraits.
I can't find the 'Trait' for RelCollation, there is no constant
like EnumerableConvention.
Is there anya special way to instantiate it?
I can't find and examplethe in Calcite tests

Thank you so much
Enrico



> Best,
> Stamatis
>
> Στις Παρ, 28 Σεπ 2018 στις 9:58 μ.μ., ο/η Enrico Olivelli <
> eolivelli@gmail.com> έγραψε:
>
> > Sorry  in advance for this very long email....
> > I am trying to debug, but I honestly I did not undestand clearly how
> > these rules work
> >
> > I have this query:
> > SELECT `tsql`.`k1`, `tsql`.`n1`, `tsql`.`s1`
> > FROM `tblspace1`.`tsql` AS `TSQL`
> >
> > This is the table:
> > CREATE TABLE tblspace1.tsql (k1 string primary key,n1 int,s1 string)
> >
> > Logical Plan Starts with:
> > LogicalSort(sort0=[$0], dir0=[ASC])
> >   LogicalProject(k1=[$0], n1=[$1], s1=[$2])
> >     LogicalTableScan(table=[[tblspace1, tsql]])
> >
> > And the Best Exp eventually is:
> > EnumerableTableScan(table=[[tblspace1, tsql]]): rowcount = 1.0,
> > cumulative cost = {1.0 rows, 2.0 cpu, 0.0 io}, id = 33
> >
> > The problem is that the Sort disappears.
> > The Table is configured with Statistics without any Collation
> > Statistics.of(tableManager.getStats().getTablesize(), keys)
> >
> > This happens if I enable these traits on the Planner:
> > ConventionTraitDef.INSTANCE, RelCollationTraitDef.INSTANCE
> >
> > if I enable only ConventionTraitDef the sort does not disappear
> >
> > These are "TRACE" level logs of the Planner
> >
> > Maybe some expert of you can see inside the logs the anwer to my problem.
> >
> > Thank you in advace, I know that your time is valuable. I appreciate
> > any kind of help
> >
> > Enrico
> >
> >
> > [main] TRACE org.apache.calcite.sql.parser - After validation: SELECT
> > `tsql`.`k1`, `tsql`.`n1`, `tsql`.`s1`
> > FROM `tblspace1`.`tsql` AS `TSQL`
> > ORDER BY `K1`
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> > LogicalTableScan#30
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> LogicalProject#31
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new LogicalSort#32
> > [main] DEBUG org.apache.calcite.sql2rel - Plan after converting
> > SqlNode to RelNode
> > LogicalSort(sort0=[$0], dir0=[ASC])
> >   LogicalProject(k1=[$0], n1=[$1], s1=[$2])
> >     LogicalTableScan(table=[[tblspace1, tsql]])
> >
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> > EnumerableTableScan#33
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> LogicalProject#34
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new LogicalSort#35
> > Query: select * from tblspace1.tsql order by k1
> > -- Best  Plan
> > LogicalSort(sort0=[$0], dir0=[ASC]): rowcount = 1.0, cumulative cost =
> > {3.0 rows, 17.0 cpu, 0.0 io}, id = 35
> >   LogicalProject(k1=[$0], n1=[$1], s1=[$2]): rowcount = 1.0,
> > cumulative cost = {2.0 rows, 5.0 cpu, 0.0 io}, id = 34
> >     EnumerableTableScan(table=[[tblspace1, tsql]]): rowcount = 1.0,
> > cumulative cost = {1.0 rows, 2.0 cpu, 0.0 io}, id = 33
> >
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#36
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Subset cost
> > improved: subset [rel#36:Subset#0.ENUMERABLE.[]] cost was {inf} now
> > {1.0 rows, 2.0 cpu, 0.0 io}
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
> > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql]) in
> > rel#36:Subset#0.ENUMERABLE.[]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > [rel#36:Subset#0.ENUMERABLE.[]] is 0.0
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> LogicalProject#37
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#38
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
> >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)
> > in rel#38:Subset#1.NONE.[]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > [rel#36:Subset#0.ENUMERABLE.[]] to its parent
> > [rel#38:Subset#1.NONE.[]] is 0.0 (parent importance=0.0, child
> > cost=3.0, parent cost=1.0E30)
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > [rel#36:Subset#0.ENUMERABLE.[]] is 0.0
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > [rel#38:Subset#1.NONE.[]] is 0.0
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > Rule-match queued: rule [EnumerableProjectRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > Rule-match queued: rule [ProjectRemoveRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > Rule-match queued: rule [ProjectScanRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new LogicalSort#39
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#40
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
> >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)
> > in rel#40:Subset#2.NONE.[0]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > [rel#38:Subset#1.NONE.[]] to its parent [rel#40:Subset#2.NONE.[0]] is
> > 0.0 (parent importance=0.0, child cost=1.0E30, parent cost=1.0E30)
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > [rel#38:Subset#1.NONE.[]] is 0.0
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > [rel#40:Subset#2.NONE.[0]] is 0.0
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > Rule-match queued: rule [SortRemoveConstantKeysRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > Rule-match queued: rule [PruneSortLimit0] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > Rule-match queued: rule [EnumerableSortRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > Rule-match queued: rule [SortProjectTransposeRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > Rule-match queued: rule [SortRemoveRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > Rule-match queued: rule [EnumerableLimitRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#41
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 1/1;
> > PHASE = PRE_PROCESS_MDR; COST = {inf}
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > rel#41:Subset#2.ENUMERABLE.[]
> > Original rel:
> > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > 0.0 io}, id = 39
> >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> > s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> > io}, id = 37
> >     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> > table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> > rows, 2.0 cpu, 0.0 io}, id = 33
> >
> > Sets:
> > Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> >     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.0
> >         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> > tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> > Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> >     rel#38:Subset#1.NONE.[], best=null, importance=0.0
> >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > rowcount=1.0, cumulative cost={inf}
> > Set#2, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> >     rel#40:Subset#2.NONE.[0], best=null, importance=0.0
> >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > rowcount=1.0, cumulative cost={inf}
> >     rel#41:Subset#2.ENUMERABLE.[], best=null, importance=0.0
> >
> > Importances: { rel#36:Subset#0.ENUMERABLE.[]=0.0
> > rel#38:Subset#1.NONE.[]=0.0 rel#40:Subset#2.NONE.[0]=0.0}
> >
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 2/1;
> > PHASE = PRE_PROCESS; COST = {inf}
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > rel#41:Subset#2.ENUMERABLE.[]
> > Original rel:
> > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > 0.0 io}, id = 39
> >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> > s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> > io}, id = 37
> >     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> > table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> > rows, 2.0 cpu, 0.0 io}, id = 33
> >
> > Sets:
> > Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> >     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.0
> >         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> > tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> > Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> >     rel#38:Subset#1.NONE.[], best=null, importance=0.0
> >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > rowcount=1.0, cumulative cost={inf}
> > Set#2, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> >     rel#40:Subset#2.NONE.[0], best=null, importance=0.0
> >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > rowcount=1.0, cumulative cost={inf}
> >     rel#41:Subset#2.ENUMERABLE.[], best=null, importance=0.0
> >
> > Importances: { rel#36:Subset#0.ENUMERABLE.[]=0.0
> > rel#38:Subset#1.NONE.[]=0.0 rel#40:Subset#2.NONE.[0]=0.0}
> >
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 3/1;
> > PHASE = OPTIMIZE; COST = {inf}
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > rel#41:Subset#2.ENUMERABLE.[]
> > Original rel:
> > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > 0.0 io}, id = 39
> >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> > s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> > io}, id = 37
> >     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> > table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> > rows, 2.0 cpu, 0.0 io}, id = 33
> >
> > Sets:
> > Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> >     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.0
> >         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> > tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> > Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> >     rel#38:Subset#1.NONE.[], best=null, importance=0.0
> >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > rowcount=1.0, cumulative cost={inf}
> > Set#2, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> >     rel#40:Subset#2.NONE.[0], best=null, importance=0.0
> >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > rowcount=1.0, cumulative cost={inf}
> >     rel#41:Subset#2.ENUMERABLE.[], best=null, importance=0.0
> >
> > Importances: { rel#36:Subset#0.ENUMERABLE.[]=0.0
> > rel#38:Subset#1.NONE.[]=0.0 rel#40:Subset#2.NONE.[0]=0.0}
> >
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> > rule [SortRemoveConstantKeysRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.0
> > rule [SortProjectTransposeRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > importance 0.0
> > rule [PruneSortLimit0] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.0
> > rule [ProjectScanRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> > importance 0.0
> > rule [ProjectRemoveRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > importance 0.0
> > rule [EnumerableSortRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.0
> > rule [EnumerableProjectRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > importance 0.0
> > rule [EnumerableLimitRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.0
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> > [SortRemoveRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#446: Apply
> > rule [SortRemoveRule] to
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#42
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
> > rel#42 via SortRemoveRule
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - call#446: Rule
> > SortRemoveRule arguments
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > created rel#42:RelSubset
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Merge set#2 into
> set#1
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#43
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> > AbstractConverter#44
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
> >
> >
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[])
> > in rel#43:Subset#1.ENUMERABLE.[]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > [rel#38:Subset#1.NONE.[]] to its parent [rel#42:Subset#1.NONE.[0]] is
> > 0.0 (parent importance=0.0, child cost=1.0E30, parent cost=1.0E30)
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > [rel#38:Subset#1.NONE.[]] to its parent
> > [rel#43:Subset#1.ENUMERABLE.[]] is 0.0 (parent importance=0.0, child
> > cost=1.0E30, parent cost=1.0E30)
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > [rel#38:Subset#1.NONE.[]] is 0.0
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > [rel#43:Subset#1.ENUMERABLE.[]] is 1.0
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > Rule-match queued: rule [ExpandConversionRule] rels
> >
> >
> [rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[])]
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#446
> > generated 1 successors: [rel#42:Subset#1.NONE.[0]]
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 4/2;
> > PHASE = OPTIMIZE; COST = {inf}
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > rel#43:Subset#1.ENUMERABLE.[]
> > Original rel:
> > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > 0.0 io}, id = 39
> >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> > s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> > io}, id = 37
> >     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> > table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> > rows, 2.0 cpu, 0.0 io}, id = 33
> >
> > Sets:
> > Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> >     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.0
> >         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> > tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> > Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> >     rel#38:Subset#1.NONE.[], best=null, importance=0.5
> >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > rowcount=1.0, cumulative cost={inf}
> >     rel#42:Subset#1.NONE.[0], best=null, importance=0.5
> >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > rowcount=1.0, cumulative cost={inf}
> >     rel#43:Subset#1.ENUMERABLE.[], best=null, importance=1.0
> >
> >
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[]),
> > rowcount=1.0, cumulative cost={inf}
> >
> > Importances: { rel#43:Subset#1.ENUMERABLE.[]=1.0
> > rel#38:Subset#1.NONE.[]=0.0 rel#36:Subset#0.ENUMERABLE.[]=0.0}
> >
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> > rule [SortRemoveConstantKeysRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.5
> > rule [SortProjectTransposeRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > importance 0.5
> > rule [PruneSortLimit0] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.5
> > rule [ProjectScanRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> > importance 0.5
> > rule [ProjectRemoveRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > importance 0.5
> > rule [EnumerableSortRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.5
> > rule [EnumerableProjectRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > importance 0.5
> > rule [EnumerableLimitRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.5
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> > [ExpandConversionRule] rels
> >
> >
> [rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[])]
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#550: Apply
> > rule [ExpandConversionRule] to
> >
> >
> [rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[])]
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#550
> > generated 0 successors.
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 5/3;
> > PHASE = OPTIMIZE; COST = {inf}
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > rel#43:Subset#1.ENUMERABLE.[]
> > Original rel:
> > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > 0.0 io}, id = 39
> >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> > s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> > io}, id = 37
> >     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> > table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> > rows, 2.0 cpu, 0.0 io}, id = 33
> >
> > Sets:
> > Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> >     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.0
> >         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> > tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> > Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> >     rel#38:Subset#1.NONE.[], best=null, importance=0.5
> >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > rowcount=1.0, cumulative cost={inf}
> >     rel#42:Subset#1.NONE.[0], best=null, importance=0.5
> >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > rowcount=1.0, cumulative cost={inf}
> >     rel#43:Subset#1.ENUMERABLE.[], best=null, importance=1.0
> >
> >
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[]),
> > rowcount=1.0, cumulative cost={inf}
> >
> > Importances: { rel#43:Subset#1.ENUMERABLE.[]=1.0
> > rel#38:Subset#1.NONE.[]=0.0 rel#36:Subset#0.ENUMERABLE.[]=0.0}
> >
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> > rule [SortProjectTransposeRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > importance 0.5
> > rule [PruneSortLimit0] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.5
> > rule [ProjectScanRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> > importance 0.5
> > rule [ProjectRemoveRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > importance 0.5
> > rule [EnumerableSortRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.5
> > rule [EnumerableProjectRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > importance 0.5
> > rule [EnumerableLimitRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.5
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> > [SortRemoveConstantKeysRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#434: Apply
> > rule [SortRemoveConstantKeysRule] to
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#434
> > generated 0 successors.
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 6/4;
> > PHASE = OPTIMIZE; COST = {inf}
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > rel#43:Subset#1.ENUMERABLE.[]
> > Original rel:
> > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > 0.0 io}, id = 39
> >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> > s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> > io}, id = 37
> >     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> > table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> > rows, 2.0 cpu, 0.0 io}, id = 33
> >
> > Sets:
> > Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> >     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.0
> >         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> > tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> > Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> >     rel#38:Subset#1.NONE.[], best=null, importance=0.5
> >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > rowcount=1.0, cumulative cost={inf}
> >     rel#42:Subset#1.NONE.[0], best=null, importance=0.5
> >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > rowcount=1.0, cumulative cost={inf}
> >     rel#43:Subset#1.ENUMERABLE.[], best=null, importance=1.0
> >
> >
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[]),
> > rowcount=1.0, cumulative cost={inf}
> >
> > Importances: { rel#43:Subset#1.ENUMERABLE.[]=1.0
> > rel#38:Subset#1.NONE.[]=0.0 rel#36:Subset#0.ENUMERABLE.[]=0.0}
> >
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> > rule [PruneSortLimit0] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.5
> > rule [ProjectScanRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> > importance 0.5
> > rule [ProjectRemoveRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > importance 0.5
> > rule [EnumerableSortRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.5
> > rule [EnumerableProjectRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > importance 0.5
> > rule [EnumerableLimitRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.5
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> > [SortProjectTransposeRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#444: Apply
> > rule [SortProjectTransposeRule] to
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new LogicalSort#45
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> LogicalProject#46
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
> > rel#46 via SortProjectTransposeRule with equivalences
> > {LogicalSort#45=rel#36:Subset#0.ENUMERABLE.[]}
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - call#444: Rule
> > SortProjectTransposeRule arguments
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > created rel#46:LogicalProject
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#47
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
> >
> >
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)
> > in rel#47:Subset#0.NONE.[0]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > [rel#36:Subset#0.ENUMERABLE.[]] to its parent
> > [rel#38:Subset#1.NONE.[]] is 1.5E-30 (parent importance=0.5, child
> > cost=3.0, parent cost=1.0E30)
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > [rel#36:Subset#0.ENUMERABLE.[]] to its parent
> > [rel#47:Subset#0.NONE.[0]] is 0.0 (parent importance=0.0, child
> > cost=3.0, parent cost=1.0E30)
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > [rel#36:Subset#0.ENUMERABLE.[]] is 1.5E-30
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > [rel#47:Subset#0.NONE.[0]] is 0.0
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > Rule-match queued: rule [SortRemoveConstantKeysRule] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > Rule-match queued: rule [PruneSortLimit0] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > Rule-match queued: rule [EnumerableSortRule] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > Rule-match queued: rule [SortRemoveRule] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > Rule-match queued: rule [EnumerableLimitRule] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> LogicalProject#48
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
> >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)
> > in rel#42:Subset#1.NONE.[0]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > [rel#47:Subset#0.NONE.[0]] to its parent [rel#42:Subset#1.NONE.[0]] is
> > 0.495 (parent importance=0.5, child cost=1.0E30, parent cost=1.0E30)
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > [rel#47:Subset#0.NONE.[0]] is 0.495
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > [rel#42:Subset#1.NONE.[0]] is 0.0
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > Rule-match queued: rule [EnumerableProjectRule] rels
> >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > Rule-match queued: rule [ProjectRemoveRule] rels
> >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > Rule-match queued: rule [SortProjectTransposeRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#444
> > generated 1 successors: [LogicalProject#46]
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 7/5;
> > PHASE = OPTIMIZE; COST = {inf}
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > rel#43:Subset#1.ENUMERABLE.[]
> > Original rel:
> > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > 0.0 io}, id = 39
> >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> > s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> > io}, id = 37
> >     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> > table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> > rows, 2.0 cpu, 0.0 io}, id = 33
> >
> > Sets:
> > Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> >     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.2475
> >         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> > tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> >     rel#47:Subset#0.NONE.[0], best=null, importance=0.495
> >
> >
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> > rowcount=1.0, cumulative cost={inf}
> > Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> >     rel#38:Subset#1.NONE.[], best=null, importance=0.5
> >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > rowcount=1.0, cumulative cost={inf}
> >     rel#42:Subset#1.NONE.[0], best=null, importance=0.5
> >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > rowcount=1.0, cumulative cost={inf}
> >     rel#43:Subset#1.ENUMERABLE.[], best=null, importance=1.0
> >
> >
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[]),
> > rowcount=1.0, cumulative cost={inf}
> >
> > Importances: { rel#43:Subset#1.ENUMERABLE.[]=1.0
> > rel#38:Subset#1.NONE.[]=0.0 rel#42:Subset#1.NONE.[0]=0.0
> > rel#47:Subset#0.NONE.[0]=0.495 rel#36:Subset#0.ENUMERABLE.[]=1.5E-30}
> >
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> > rule [ProjectRemoveRule] rels
> >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > importance 0.5
> > rule [EnumerableProjectRule] rels
> >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > importance 0.5
> > rule [SortRemoveRule] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [SortRemoveConstantKeysRule] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [PruneSortLimit0] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [EnumerableSortRule] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [EnumerableLimitRule] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [PruneSortLimit0] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.5
> > rule [ProjectScanRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> > importance 0.5
> > rule [ProjectRemoveRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > importance 0.5
> > rule [EnumerableSortRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.5
> > rule [EnumerableProjectRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > importance 0.5
> > rule [EnumerableLimitRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.5
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Skip match: rule
> > [SortProjectTransposeRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> > rule [EnumerableProjectRule] rels
> >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > importance 0.5
> > rule [SortRemoveRule] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [SortRemoveConstantKeysRule] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [PruneSortLimit0] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [EnumerableSortRule] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [EnumerableLimitRule] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [PruneSortLimit0] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.5
> > rule [ProjectScanRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> > importance 0.5
> > rule [ProjectRemoveRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > importance 0.5
> > rule [EnumerableSortRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.5
> > rule [EnumerableProjectRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > importance 0.5
> > rule [EnumerableLimitRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.5
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> > [ProjectRemoveRule] rels
> >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#617: Apply
> > rule [ProjectRemoveRule] to
> >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Register #47
> > rel#47:Subset#0.NONE.[0], and merge sets
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Merge set#1 into
> set#0
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#49
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Rename #39 from
> > 'LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)'
> > to
> 'LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)'
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Rename #44 from
> >
> >
> 'AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[])'
> > to
> >
> 'AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])'
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > Rule-match queued: rule [SortProjectTransposeRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > Rule-match queued: rule [SortRemoveConstantKeysRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > Rule-match queued: rule [PruneSortLimit0] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > Rule-match queued: rule [EnumerableSortRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > Rule-match queued: rule [SortProjectTransposeRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > Rule-match queued: rule [SortRemoveRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > Rule-match queued: rule [EnumerableLimitRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > Rule-match queued: rule [ProjectMergeRule:force_mode] rels
> >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > Rule-match queued: rule [ExpandConversionRule] rels
> >
> >
> [rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
> > rel#47 via ProjectRemoveRule
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - call#617: Rule
> > ProjectRemoveRule arguments
> >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > created rel#47:RelSubset
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#617
> > generated 1 successors: [rel#47:Subset#0.NONE.[0]]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - boostImportance(1.0,
> > [])
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 8/6;
> > PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > rel#36:Subset#0.ENUMERABLE.[]
> > Original rel:
> > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > 0.0 io}, id = 39
> >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> > s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> > io}, id = 37
> >     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> > table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> > rows, 2.0 cpu, 0.0 io}, id = 33
> >
> > Sets:
> > Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> >     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.2475
> >         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> > tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> >
> >
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
> > rowcount=1.0, cumulative cost={inf}
> >     rel#47:Subset#0.NONE.[0], best=null, importance=0.495
> >
> >
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > rowcount=1.0, cumulative cost={inf}
> >     rel#49:Subset#0.NONE.[], best=null, importance=0.2475
> >
> >
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > rowcount=1.0, cumulative cost={inf}
> >
> > Importances: { rel#47:Subset#0.NONE.[0]=0.495
> > rel#36:Subset#0.ENUMERABLE.[]=1.5E-30}
> >
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> > rule [SortRemoveRule] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [SortRemoveRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [SortRemoveConstantKeysRule] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [SortRemoveConstantKeysRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [SortProjectTransposeRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > importance 0.495
> > rule [SortProjectTransposeRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > importance 0.495
> > rule [PruneSortLimit0] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [PruneSortLimit0] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [ProjectMergeRule:force_mode] rels
> >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > importance 0.495
> > rule [EnumerableSortRule] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [EnumerableSortRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [EnumerableLimitRule] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [EnumerableLimitRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [ExpandConversionRule] rels
> >
> >
> [rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
> > importance 0.2475
> > rule [PruneSortLimit0] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [ProjectScanRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> > importance 0.2475
> > rule [ProjectRemoveRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > importance 0.2475
> > rule [EnumerableSortRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [EnumerableProjectRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > importance 0.2475
> > rule [EnumerableLimitRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> > [EnumerableProjectRule] rels
> >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#615: Apply
> > rule [EnumerableProjectRule] to
> >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#50
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> > EnumerableProject#51
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
> > rel#51 via EnumerableProjectRule
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - call#615: Rule
> > EnumerableProjectRule arguments
> >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > created rel#51:EnumerableProject
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
> >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)
> > in rel#50:Subset#0.ENUMERABLE.[0]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > [rel#50:Subset#0.ENUMERABLE.[0]] to its parent
> > [rel#50:Subset#0.ENUMERABLE.[0]] is 0.245025 (parent
> > importance=0.2475, child cost=1.0E30, parent cost=1.0E30)
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> > [rel#50:Subset#0.ENUMERABLE.[0]] is 0.245025
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > Rule-match queued: rule [ProjectMergeRule:force_mode] rels
> >
> >
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > Rule-match queued: rule [ProjectMergeRule:force_mode] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> > Rule-match queued: rule [ProjectRemoveRule] rels
> >
> >
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#615
> > generated 1 successors:
> >
> >
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 9/7;
> > PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > rel#36:Subset#0.ENUMERABLE.[]
> > Original rel:
> > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > 0.0 io}, id = 39
> >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> > s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> > io}, id = 37
> >     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> > table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> > rows, 2.0 cpu, 0.0 io}, id = 33
> >
> > Sets:
> > Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> >     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.2475
> >         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> > tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> >
> >
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> > rowcount=1.0, cumulative cost={inf}
> >     rel#47:Subset#0.NONE.[0], best=null, importance=0.495
> >
> >
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > rowcount=1.0, cumulative cost={inf}
> >     rel#49:Subset#0.NONE.[], best=null, importance=0.2475
> >
> >
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > rowcount=1.0, cumulative cost={inf}
> >     rel#50:Subset#0.ENUMERABLE.[0], best=null, importance=0.2475
> >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> > rowcount=1.0, cumulative cost={inf}
> >
> > Importances: { rel#47:Subset#0.NONE.[0]=0.495
> > rel#36:Subset#0.ENUMERABLE.[]=1.5E-30
> > rel#50:Subset#0.ENUMERABLE.[0]=0.245025}
> >
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> > rule [SortRemoveRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [SortRemoveConstantKeysRule] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [SortRemoveConstantKeysRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [SortProjectTransposeRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > importance 0.495
> > rule [SortProjectTransposeRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > importance 0.495
> > rule [PruneSortLimit0] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [PruneSortLimit0] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [ProjectMergeRule:force_mode] rels
> >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > importance 0.495
> > rule [EnumerableSortRule] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [EnumerableSortRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [EnumerableLimitRule] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [EnumerableLimitRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [ProjectRemoveRule] rels
> >
> >
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > importance 0.2475
> > rule [ProjectMergeRule:force_mode] rels
> >
> >
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > importance 0.2475
> > rule [ProjectMergeRule:force_mode] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > importance 0.2475
> > rule [ExpandConversionRule] rels
> >
> >
> [rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
> > importance 0.2475
> > rule [PruneSortLimit0] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [ProjectScanRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> > importance 0.2475
> > rule [ProjectRemoveRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > importance 0.2475
> > rule [EnumerableSortRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [EnumerableProjectRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > importance 0.2475
> > rule [EnumerableLimitRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> > [SortRemoveRule] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#571: Apply
> > rule [SortRemoveRule] to
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
> > rel#50 via SortRemoveRule
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - call#571: Rule
> > SortRemoveRule arguments
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > created rel#50:RelSubset
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#571
> > generated 1 successors: [rel#50:Subset#0.ENUMERABLE.[0]]
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 10/8;
> > PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > rel#36:Subset#0.ENUMERABLE.[]
> > Original rel:
> > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > 0.0 io}, id = 39
> >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> > s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> > io}, id = 37
> >     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> > table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> > rows, 2.0 cpu, 0.0 io}, id = 33
> >
> > Sets:
> > Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> >     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.2475
> >         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> > tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> >
> >
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> > rowcount=1.0, cumulative cost={inf}
> >     rel#47:Subset#0.NONE.[0], best=null, importance=0.495
> >
> >
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > rowcount=1.0, cumulative cost={inf}
> >     rel#49:Subset#0.NONE.[], best=null, importance=0.2475
> >
> >
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > rowcount=1.0, cumulative cost={inf}
> >     rel#50:Subset#0.ENUMERABLE.[0], best=null, importance=0.2475
> >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> > rowcount=1.0, cumulative cost={inf}
> >
> > Importances: { rel#47:Subset#0.NONE.[0]=0.495
> > rel#36:Subset#0.ENUMERABLE.[]=1.5E-30
> > rel#50:Subset#0.ENUMERABLE.[0]=0.245025}
> >
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> > rule [SortRemoveConstantKeysRule] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [SortRemoveConstantKeysRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [SortProjectTransposeRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > importance 0.495
> > rule [SortProjectTransposeRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > importance 0.495
> > rule [PruneSortLimit0] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [PruneSortLimit0] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [ProjectMergeRule:force_mode] rels
> >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > importance 0.495
> > rule [EnumerableSortRule] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [EnumerableSortRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [EnumerableLimitRule] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [EnumerableLimitRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [ProjectRemoveRule] rels
> >
> >
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > importance 0.2475
> > rule [ProjectMergeRule:force_mode] rels
> >
> >
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > importance 0.2475
> > rule [ProjectMergeRule:force_mode] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > importance 0.2475
> > rule [ExpandConversionRule] rels
> >
> >
> [rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
> > importance 0.2475
> > rule [PruneSortLimit0] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [ProjectScanRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> > importance 0.2475
> > rule [ProjectRemoveRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > importance 0.2475
> > rule [EnumerableSortRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [EnumerableProjectRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > importance 0.2475
> > rule [EnumerableLimitRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> > [SortRemoveRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#737: Apply
> > rule [SortRemoveRule] to
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
> > rel#47 via SortRemoveRule
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - call#737: Rule
> > SortRemoveRule arguments
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > created rel#47:RelSubset
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#737
> > generated 1 successors: [rel#47:Subset#0.NONE.[0]]
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 11/9;
> > PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > rel#36:Subset#0.ENUMERABLE.[]
> > Original rel:
> > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > 0.0 io}, id = 39
> >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> > s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> > io}, id = 37
> >     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> > table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> > rows, 2.0 cpu, 0.0 io}, id = 33
> >
> > Sets:
> > Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> >     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.2475
> >         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> > tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> >
> >
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> > rowcount=1.0, cumulative cost={inf}
> >     rel#47:Subset#0.NONE.[0], best=null, importance=0.495
> >
> >
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > rowcount=1.0, cumulative cost={inf}
> >     rel#49:Subset#0.NONE.[], best=null, importance=0.2475
> >
> >
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > rowcount=1.0, cumulative cost={inf}
> >     rel#50:Subset#0.ENUMERABLE.[0], best=null, importance=0.2475
> >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> > rowcount=1.0, cumulative cost={inf}
> >
> > Importances: { rel#47:Subset#0.NONE.[0]=0.495
> > rel#36:Subset#0.ENUMERABLE.[]=1.5E-30
> > rel#50:Subset#0.ENUMERABLE.[0]=0.245025}
> >
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> > rule [SortRemoveConstantKeysRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [SortProjectTransposeRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > importance 0.495
> > rule [SortProjectTransposeRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > importance 0.495
> > rule [PruneSortLimit0] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [PruneSortLimit0] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [ProjectMergeRule:force_mode] rels
> >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > importance 0.495
> > rule [EnumerableSortRule] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [EnumerableSortRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [EnumerableLimitRule] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [EnumerableLimitRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [ProjectRemoveRule] rels
> >
> >
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > importance 0.2475
> > rule [ProjectMergeRule:force_mode] rels
> >
> >
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > importance 0.2475
> > rule [ProjectMergeRule:force_mode] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > importance 0.2475
> > rule [ExpandConversionRule] rels
> >
> >
> [rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
> > importance 0.2475
> > rule [PruneSortLimit0] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [ProjectScanRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> > importance 0.2475
> > rule [ProjectRemoveRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > importance 0.2475
> > rule [EnumerableSortRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [EnumerableProjectRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > importance 0.2475
> > rule [EnumerableLimitRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> > [SortRemoveConstantKeysRule] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#560: Apply
> > rule [SortRemoveConstantKeysRule] to
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#560
> > generated 0 successors.
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 12/10;
> > PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > rel#36:Subset#0.ENUMERABLE.[]
> > Original rel:
> > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > 0.0 io}, id = 39
> >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> > s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> > io}, id = 37
> >     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> > table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> > rows, 2.0 cpu, 0.0 io}, id = 33
> >
> > Sets:
> > Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
> >     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.2475
> >         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> > tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> >
> >
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> > rowcount=1.0, cumulative cost={inf}
> >     rel#47:Subset#0.NONE.[0], best=null, importance=0.495
> >
> >
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > rowcount=1.0, cumulative cost={inf}
> >     rel#49:Subset#0.NONE.[], best=null, importance=0.2475
> >
> >
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> > rowcount=1.0, cumulative cost={inf}
> >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> > rowcount=1.0, cumulative cost={inf}
> >     rel#50:Subset#0.ENUMERABLE.[0], best=null, importance=0.2475
> >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> > rowcount=1.0, cumulative cost={inf}
> >
> > Importances: { rel#47:Subset#0.NONE.[0]=0.495
> > rel#36:Subset#0.ENUMERABLE.[]=1.5E-30
> > rel#50:Subset#0.ENUMERABLE.[0]=0.245025}
> >
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> > rule [SortProjectTransposeRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > importance 0.495
> > rule [SortProjectTransposeRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> >
> >
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > importance 0.495
> > rule [PruneSortLimit0] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [PruneSortLimit0] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [ProjectMergeRule:force_mode] rels
> >
> >
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> >
> >
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> > importance 0.495
> > rule [EnumerableSortRule] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [EnumerableSortRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [EnumerableLimitRule] rels
> >
> >
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [EnumerableLimitRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [ProjectRemoveRule] rels
> >
> >
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > importance 0.2475
> > rule [ProjectMergeRule:force_mode] rels
> >
> >
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > importance 0.2475
> > rule [ProjectMergeRule:force_mode] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> >
> >
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> > importance 0.2475
> > rule [ExpandConversionRule] rels
> >
> >
> [rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
> > importance 0.2475
> > rule [PruneSortLimit0] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [ProjectScanRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> > rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> > importance 0.2475
> > rule [ProjectRemoveRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > importance 0.2475
> > rule [EnumerableSortRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > rule [EnumerableProjectRule] rels
> >
> >
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> > importance 0.2475
> > rule [EnumerableLimitRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> > importance 0.495
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> > [SortRemoveConstantKeysRule] rels
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#724: Apply
> > rule [SortRemoveConstantKeysRule] to
> >
> >
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#724
> > generated 0 successors.
> > [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> > org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 13/11;
> > PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
> > [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> > rel#36:Subset#0.ENUMERABLE.[]
> > Original rel:
> > LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> > dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> > 0.0 io}, id = 39
> >   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$

-- 


-- Enrico Olivelli

Re: Help with EnumerableMergeJoinRule which is losing a RelCollection trait

Posted by Stamatis Zampetakis <za...@gmail.com>.
Hi Enrico,

I didn't look thoroughly but I suspect that maybe the problem is when you
set the desiredTraits (
https://github.com/diennea/herddb/blob/0c7c01584350d57d8102511b987e5f880f3f65bd/herddb-core/src/main/java/herddb/sql/CalcitePlanner.java#L449).
Apart from the EnumerableConvention, I think you should also set the
expected RelCollationTrait. Can you check what are the desiredTraits that
you are passing to the optimizer?

Best,
Stamatis

Στις Παρ, 28 Σεπ 2018 στις 9:58 μ.μ., ο/η Enrico Olivelli <
eolivelli@gmail.com> έγραψε:

> Sorry  in advance for this very long email....
> I am trying to debug, but I honestly I did not undestand clearly how
> these rules work
>
> I have this query:
> SELECT `tsql`.`k1`, `tsql`.`n1`, `tsql`.`s1`
> FROM `tblspace1`.`tsql` AS `TSQL`
>
> This is the table:
> CREATE TABLE tblspace1.tsql (k1 string primary key,n1 int,s1 string)
>
> Logical Plan Starts with:
> LogicalSort(sort0=[$0], dir0=[ASC])
>   LogicalProject(k1=[$0], n1=[$1], s1=[$2])
>     LogicalTableScan(table=[[tblspace1, tsql]])
>
> And the Best Exp eventually is:
> EnumerableTableScan(table=[[tblspace1, tsql]]): rowcount = 1.0,
> cumulative cost = {1.0 rows, 2.0 cpu, 0.0 io}, id = 33
>
> The problem is that the Sort disappears.
> The Table is configured with Statistics without any Collation
> Statistics.of(tableManager.getStats().getTablesize(), keys)
>
> This happens if I enable these traits on the Planner:
> ConventionTraitDef.INSTANCE, RelCollationTraitDef.INSTANCE
>
> if I enable only ConventionTraitDef the sort does not disappear
>
> These are "TRACE" level logs of the Planner
>
> Maybe some expert of you can see inside the logs the anwer to my problem.
>
> Thank you in advace, I know that your time is valuable. I appreciate
> any kind of help
>
> Enrico
>
>
> [main] TRACE org.apache.calcite.sql.parser - After validation: SELECT
> `tsql`.`k1`, `tsql`.`n1`, `tsql`.`s1`
> FROM `tblspace1`.`tsql` AS `TSQL`
> ORDER BY `K1`
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> LogicalTableScan#30
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - new LogicalProject#31
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - new LogicalSort#32
> [main] DEBUG org.apache.calcite.sql2rel - Plan after converting
> SqlNode to RelNode
> LogicalSort(sort0=[$0], dir0=[ASC])
>   LogicalProject(k1=[$0], n1=[$1], s1=[$2])
>     LogicalTableScan(table=[[tblspace1, tsql]])
>
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> EnumerableTableScan#33
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - new LogicalProject#34
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - new LogicalSort#35
> Query: select * from tblspace1.tsql order by k1
> -- Best  Plan
> LogicalSort(sort0=[$0], dir0=[ASC]): rowcount = 1.0, cumulative cost =
> {3.0 rows, 17.0 cpu, 0.0 io}, id = 35
>   LogicalProject(k1=[$0], n1=[$1], s1=[$2]): rowcount = 1.0,
> cumulative cost = {2.0 rows, 5.0 cpu, 0.0 io}, id = 34
>     EnumerableTableScan(table=[[tblspace1, tsql]]): rowcount = 1.0,
> cumulative cost = {1.0 rows, 2.0 cpu, 0.0 io}, id = 33
>
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#36
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Subset cost
> improved: subset [rel#36:Subset#0.ENUMERABLE.[]] cost was {inf} now
> {1.0 rows, 2.0 cpu, 0.0 io}
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
> rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql]) in
> rel#36:Subset#0.ENUMERABLE.[]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> [rel#36:Subset#0.ENUMERABLE.[]] is 0.0
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - new LogicalProject#37
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#38
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
>
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)
> in rel#38:Subset#1.NONE.[]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> [rel#36:Subset#0.ENUMERABLE.[]] to its parent
> [rel#38:Subset#1.NONE.[]] is 0.0 (parent importance=0.0, child
> cost=3.0, parent cost=1.0E30)
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> [rel#36:Subset#0.ENUMERABLE.[]] is 0.0
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> [rel#38:Subset#1.NONE.[]] is 0.0
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> Rule-match queued: rule [EnumerableProjectRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> Rule-match queued: rule [ProjectRemoveRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> Rule-match queued: rule [ProjectScanRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - new LogicalSort#39
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#40
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
>
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)
> in rel#40:Subset#2.NONE.[0]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> [rel#38:Subset#1.NONE.[]] to its parent [rel#40:Subset#2.NONE.[0]] is
> 0.0 (parent importance=0.0, child cost=1.0E30, parent cost=1.0E30)
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> [rel#38:Subset#1.NONE.[]] is 0.0
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> [rel#40:Subset#2.NONE.[0]] is 0.0
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> Rule-match queued: rule [SortRemoveConstantKeysRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> Rule-match queued: rule [PruneSortLimit0] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> Rule-match queued: rule [EnumerableSortRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> Rule-match queued: rule [SortProjectTransposeRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
>
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> Rule-match queued: rule [SortRemoveRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> Rule-match queued: rule [EnumerableLimitRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#41
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 1/1;
> PHASE = PRE_PROCESS_MDR; COST = {inf}
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> rel#41:Subset#2.ENUMERABLE.[]
> Original rel:
> LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> 0.0 io}, id = 39
>   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> io}, id = 37
>     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> rows, 2.0 cpu, 0.0 io}, id = 33
>
> Sets:
> Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
>     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.0
>         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
>     rel#38:Subset#1.NONE.[], best=null, importance=0.0
>
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
> Set#2, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
>     rel#40:Subset#2.NONE.[0], best=null, importance=0.0
>
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>     rel#41:Subset#2.ENUMERABLE.[], best=null, importance=0.0
>
> Importances: { rel#36:Subset#0.ENUMERABLE.[]=0.0
> rel#38:Subset#1.NONE.[]=0.0 rel#40:Subset#2.NONE.[0]=0.0}
>
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 2/1;
> PHASE = PRE_PROCESS; COST = {inf}
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> rel#41:Subset#2.ENUMERABLE.[]
> Original rel:
> LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> 0.0 io}, id = 39
>   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> io}, id = 37
>     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> rows, 2.0 cpu, 0.0 io}, id = 33
>
> Sets:
> Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
>     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.0
>         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
>     rel#38:Subset#1.NONE.[], best=null, importance=0.0
>
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
> Set#2, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
>     rel#40:Subset#2.NONE.[0], best=null, importance=0.0
>
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>     rel#41:Subset#2.ENUMERABLE.[], best=null, importance=0.0
>
> Importances: { rel#36:Subset#0.ENUMERABLE.[]=0.0
> rel#38:Subset#1.NONE.[]=0.0 rel#40:Subset#2.NONE.[0]=0.0}
>
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 3/1;
> PHASE = OPTIMIZE; COST = {inf}
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> rel#41:Subset#2.ENUMERABLE.[]
> Original rel:
> LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> 0.0 io}, id = 39
>   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> io}, id = 37
>     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> rows, 2.0 cpu, 0.0 io}, id = 33
>
> Sets:
> Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
>     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.0
>         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
>     rel#38:Subset#1.NONE.[], best=null, importance=0.0
>
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
> Set#2, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
>     rel#40:Subset#2.NONE.[0], best=null, importance=0.0
>
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>     rel#41:Subset#2.ENUMERABLE.[], best=null, importance=0.0
>
> Importances: { rel#36:Subset#0.ENUMERABLE.[]=0.0
> rel#38:Subset#1.NONE.[]=0.0 rel#40:Subset#2.NONE.[0]=0.0}
>
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> rule [SortRemoveConstantKeysRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.0
> rule [SortProjectTransposeRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
>
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.0
> rule [PruneSortLimit0] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.0
> rule [ProjectScanRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> importance 0.0
> rule [ProjectRemoveRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.0
> rule [EnumerableSortRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.0
> rule [EnumerableProjectRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.0
> rule [EnumerableLimitRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.0
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> [SortRemoveRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#446: Apply
> rule [SortRemoveRule] to
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#42
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
> rel#42 via SortRemoveRule
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - call#446: Rule
> SortRemoveRule arguments
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> created rel#42:RelSubset
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Merge set#2 into set#1
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#43
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> AbstractConverter#44
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
>
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[])
> in rel#43:Subset#1.ENUMERABLE.[]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> [rel#38:Subset#1.NONE.[]] to its parent [rel#42:Subset#1.NONE.[0]] is
> 0.0 (parent importance=0.0, child cost=1.0E30, parent cost=1.0E30)
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> [rel#38:Subset#1.NONE.[]] to its parent
> [rel#43:Subset#1.ENUMERABLE.[]] is 0.0 (parent importance=0.0, child
> cost=1.0E30, parent cost=1.0E30)
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> [rel#38:Subset#1.NONE.[]] is 0.0
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> [rel#43:Subset#1.ENUMERABLE.[]] is 1.0
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> Rule-match queued: rule [ExpandConversionRule] rels
>
> [rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[])]
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#446
> generated 1 successors: [rel#42:Subset#1.NONE.[0]]
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 4/2;
> PHASE = OPTIMIZE; COST = {inf}
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> rel#43:Subset#1.ENUMERABLE.[]
> Original rel:
> LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> 0.0 io}, id = 39
>   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> io}, id = 37
>     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> rows, 2.0 cpu, 0.0 io}, id = 33
>
> Sets:
> Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
>     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.0
>         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
>     rel#38:Subset#1.NONE.[], best=null, importance=0.5
>
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>     rel#42:Subset#1.NONE.[0], best=null, importance=0.5
>
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>     rel#43:Subset#1.ENUMERABLE.[], best=null, importance=1.0
>
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[]),
> rowcount=1.0, cumulative cost={inf}
>
> Importances: { rel#43:Subset#1.ENUMERABLE.[]=1.0
> rel#38:Subset#1.NONE.[]=0.0 rel#36:Subset#0.ENUMERABLE.[]=0.0}
>
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> rule [SortRemoveConstantKeysRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.5
> rule [SortProjectTransposeRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
>
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.5
> rule [PruneSortLimit0] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.5
> rule [ProjectScanRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> importance 0.5
> rule [ProjectRemoveRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.5
> rule [EnumerableSortRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.5
> rule [EnumerableProjectRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.5
> rule [EnumerableLimitRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.5
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> [ExpandConversionRule] rels
>
> [rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[])]
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#550: Apply
> rule [ExpandConversionRule] to
>
> [rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[])]
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#550
> generated 0 successors.
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 5/3;
> PHASE = OPTIMIZE; COST = {inf}
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> rel#43:Subset#1.ENUMERABLE.[]
> Original rel:
> LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> 0.0 io}, id = 39
>   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> io}, id = 37
>     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> rows, 2.0 cpu, 0.0 io}, id = 33
>
> Sets:
> Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
>     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.0
>         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
>     rel#38:Subset#1.NONE.[], best=null, importance=0.5
>
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>     rel#42:Subset#1.NONE.[0], best=null, importance=0.5
>
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>     rel#43:Subset#1.ENUMERABLE.[], best=null, importance=1.0
>
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[]),
> rowcount=1.0, cumulative cost={inf}
>
> Importances: { rel#43:Subset#1.ENUMERABLE.[]=1.0
> rel#38:Subset#1.NONE.[]=0.0 rel#36:Subset#0.ENUMERABLE.[]=0.0}
>
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> rule [SortProjectTransposeRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
>
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.5
> rule [PruneSortLimit0] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.5
> rule [ProjectScanRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> importance 0.5
> rule [ProjectRemoveRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.5
> rule [EnumerableSortRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.5
> rule [EnumerableProjectRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.5
> rule [EnumerableLimitRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.5
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> [SortRemoveConstantKeysRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#434: Apply
> rule [SortRemoveConstantKeysRule] to
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#434
> generated 0 successors.
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 6/4;
> PHASE = OPTIMIZE; COST = {inf}
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> rel#43:Subset#1.ENUMERABLE.[]
> Original rel:
> LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> 0.0 io}, id = 39
>   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> io}, id = 37
>     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> rows, 2.0 cpu, 0.0 io}, id = 33
>
> Sets:
> Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
>     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.0
>         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
> Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
>     rel#38:Subset#1.NONE.[], best=null, importance=0.5
>
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>     rel#42:Subset#1.NONE.[0], best=null, importance=0.5
>
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>     rel#43:Subset#1.ENUMERABLE.[], best=null, importance=1.0
>
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[]),
> rowcount=1.0, cumulative cost={inf}
>
> Importances: { rel#43:Subset#1.ENUMERABLE.[]=1.0
> rel#38:Subset#1.NONE.[]=0.0 rel#36:Subset#0.ENUMERABLE.[]=0.0}
>
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> rule [PruneSortLimit0] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.5
> rule [ProjectScanRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> importance 0.5
> rule [ProjectRemoveRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.5
> rule [EnumerableSortRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.5
> rule [EnumerableProjectRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.5
> rule [EnumerableLimitRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.5
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> [SortProjectTransposeRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
>
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#444: Apply
> rule [SortProjectTransposeRule] to
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
>
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - new LogicalSort#45
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - new LogicalProject#46
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
> rel#46 via SortProjectTransposeRule with equivalences
> {LogicalSort#45=rel#36:Subset#0.ENUMERABLE.[]}
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - call#444: Rule
> SortProjectTransposeRule arguments
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
>
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> created rel#46:LogicalProject
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#47
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
>
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)
> in rel#47:Subset#0.NONE.[0]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> [rel#36:Subset#0.ENUMERABLE.[]] to its parent
> [rel#38:Subset#1.NONE.[]] is 1.5E-30 (parent importance=0.5, child
> cost=3.0, parent cost=1.0E30)
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> [rel#36:Subset#0.ENUMERABLE.[]] to its parent
> [rel#47:Subset#0.NONE.[0]] is 0.0 (parent importance=0.0, child
> cost=3.0, parent cost=1.0E30)
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> [rel#36:Subset#0.ENUMERABLE.[]] is 1.5E-30
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> [rel#47:Subset#0.NONE.[0]] is 0.0
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> Rule-match queued: rule [SortRemoveConstantKeysRule] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> Rule-match queued: rule [PruneSortLimit0] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> Rule-match queued: rule [EnumerableSortRule] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> Rule-match queued: rule [SortRemoveRule] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> Rule-match queued: rule [EnumerableLimitRule] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - new LogicalProject#48
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
>
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)
> in rel#42:Subset#1.NONE.[0]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> [rel#47:Subset#0.NONE.[0]] to its parent [rel#42:Subset#1.NONE.[0]] is
> 0.495 (parent importance=0.5, child cost=1.0E30, parent cost=1.0E30)
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> [rel#47:Subset#0.NONE.[0]] is 0.495
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> [rel#42:Subset#1.NONE.[0]] is 0.0
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> Rule-match queued: rule [EnumerableProjectRule] rels
>
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> Rule-match queued: rule [ProjectRemoveRule] rels
>
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> Rule-match queued: rule [SortProjectTransposeRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
>
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#444
> generated 1 successors: [LogicalProject#46]
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 7/5;
> PHASE = OPTIMIZE; COST = {inf}
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> rel#43:Subset#1.ENUMERABLE.[]
> Original rel:
> LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> 0.0 io}, id = 39
>   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> io}, id = 37
>     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> rows, 2.0 cpu, 0.0 io}, id = 33
>
> Sets:
> Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
>     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.2475
>         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
>     rel#47:Subset#0.NONE.[0], best=null, importance=0.495
>
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
> Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
>     rel#38:Subset#1.NONE.[], best=null, importance=0.5
>
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>     rel#42:Subset#1.NONE.[0], best=null, importance=0.5
>
> rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>     rel#43:Subset#1.ENUMERABLE.[], best=null, importance=1.0
>
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[]),
> rowcount=1.0, cumulative cost={inf}
>
> Importances: { rel#43:Subset#1.ENUMERABLE.[]=1.0
> rel#38:Subset#1.NONE.[]=0.0 rel#42:Subset#1.NONE.[0]=0.0
> rel#47:Subset#0.NONE.[0]=0.495 rel#36:Subset#0.ENUMERABLE.[]=1.5E-30}
>
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> rule [ProjectRemoveRule] rels
>
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> importance 0.5
> rule [EnumerableProjectRule] rels
>
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> importance 0.5
> rule [SortRemoveRule] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [SortRemoveConstantKeysRule] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [PruneSortLimit0] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [EnumerableSortRule] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [EnumerableLimitRule] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [PruneSortLimit0] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.5
> rule [ProjectScanRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> importance 0.5
> rule [ProjectRemoveRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.5
> rule [EnumerableSortRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.5
> rule [EnumerableProjectRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.5
> rule [EnumerableLimitRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.5
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Skip match: rule
> [SortProjectTransposeRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
>
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> rule [EnumerableProjectRule] rels
>
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> importance 0.5
> rule [SortRemoveRule] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [SortRemoveConstantKeysRule] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [PruneSortLimit0] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [EnumerableSortRule] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [EnumerableLimitRule] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [PruneSortLimit0] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.5
> rule [ProjectScanRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> importance 0.5
> rule [ProjectRemoveRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.5
> rule [EnumerableSortRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.5
> rule [EnumerableProjectRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.5
> rule [EnumerableLimitRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.5
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> [ProjectRemoveRule] rels
>
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#617: Apply
> rule [ProjectRemoveRule] to
>
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Register #47
> rel#47:Subset#0.NONE.[0], and merge sets
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Merge set#1 into set#0
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#49
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Rename #39 from
> 'LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)'
> to 'LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)'
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Rename #44 from
>
> 'AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[])'
> to
> 'AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])'
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> Rule-match queued: rule [SortProjectTransposeRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
>
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> Rule-match queued: rule [SortRemoveConstantKeysRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> Rule-match queued: rule [PruneSortLimit0] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> Rule-match queued: rule [EnumerableSortRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> Rule-match queued: rule [SortProjectTransposeRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
>
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> Rule-match queued: rule [SortRemoveRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> Rule-match queued: rule [EnumerableLimitRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> Rule-match queued: rule [ProjectMergeRule:force_mode] rels
>
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
>
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> Rule-match queued: rule [ExpandConversionRule] rels
>
> [rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
> rel#47 via ProjectRemoveRule
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - call#617: Rule
> ProjectRemoveRule arguments
>
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> created rel#47:RelSubset
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#617
> generated 1 successors: [rel#47:Subset#0.NONE.[0]]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - boostImportance(1.0,
> [])
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 8/6;
> PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> rel#36:Subset#0.ENUMERABLE.[]
> Original rel:
> LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> 0.0 io}, id = 39
>   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> io}, id = 37
>     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> rows, 2.0 cpu, 0.0 io}, id = 33
>
> Sets:
> Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
>     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.2475
>         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
>
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
> rowcount=1.0, cumulative cost={inf}
>     rel#47:Subset#0.NONE.[0], best=null, importance=0.495
>
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>     rel#49:Subset#0.NONE.[], best=null, importance=0.2475
>
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>
> Importances: { rel#47:Subset#0.NONE.[0]=0.495
> rel#36:Subset#0.ENUMERABLE.[]=1.5E-30}
>
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> rule [SortRemoveRule] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [SortRemoveRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [SortRemoveConstantKeysRule] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [SortRemoveConstantKeysRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [SortProjectTransposeRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
>
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> importance 0.495
> rule [SortProjectTransposeRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
>
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.495
> rule [PruneSortLimit0] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [PruneSortLimit0] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [ProjectMergeRule:force_mode] rels
>
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
>
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> importance 0.495
> rule [EnumerableSortRule] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [EnumerableSortRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [EnumerableLimitRule] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [EnumerableLimitRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [ExpandConversionRule] rels
>
> [rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
> importance 0.2475
> rule [PruneSortLimit0] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [ProjectScanRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> importance 0.2475
> rule [ProjectRemoveRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.2475
> rule [EnumerableSortRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [EnumerableProjectRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.2475
> rule [EnumerableLimitRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> [EnumerableProjectRule] rels
>
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#615: Apply
> rule [EnumerableProjectRule] to
>
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#50
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - new
> EnumerableProject#51
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
> rel#51 via EnumerableProjectRule
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - call#615: Rule
> EnumerableProjectRule arguments
>
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> created rel#51:EnumerableProject
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
>
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)
> in rel#50:Subset#0.ENUMERABLE.[0]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> [rel#50:Subset#0.ENUMERABLE.[0]] to its parent
> [rel#50:Subset#0.ENUMERABLE.[0]] is 0.245025 (parent
> importance=0.2475, child cost=1.0E30, parent cost=1.0E30)
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
> [rel#50:Subset#0.ENUMERABLE.[0]] is 0.245025
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> Rule-match queued: rule [ProjectMergeRule:force_mode] rels
>
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
>
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> Rule-match queued: rule [ProjectMergeRule:force_mode] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
>
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
> Rule-match queued: rule [ProjectRemoveRule] rels
>
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#615
> generated 1 successors:
>
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 9/7;
> PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> rel#36:Subset#0.ENUMERABLE.[]
> Original rel:
> LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> 0.0 io}, id = 39
>   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> io}, id = 37
>     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> rows, 2.0 cpu, 0.0 io}, id = 33
>
> Sets:
> Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
>     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.2475
>         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
>
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
> rowcount=1.0, cumulative cost={inf}
>
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>     rel#47:Subset#0.NONE.[0], best=null, importance=0.495
>
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>     rel#49:Subset#0.NONE.[], best=null, importance=0.2475
>
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>     rel#50:Subset#0.ENUMERABLE.[0], best=null, importance=0.2475
>
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>
> Importances: { rel#47:Subset#0.NONE.[0]=0.495
> rel#36:Subset#0.ENUMERABLE.[]=1.5E-30
> rel#50:Subset#0.ENUMERABLE.[0]=0.245025}
>
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> rule [SortRemoveRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [SortRemoveConstantKeysRule] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [SortRemoveConstantKeysRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [SortProjectTransposeRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
>
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> importance 0.495
> rule [SortProjectTransposeRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
>
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.495
> rule [PruneSortLimit0] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [PruneSortLimit0] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [ProjectMergeRule:force_mode] rels
>
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
>
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> importance 0.495
> rule [EnumerableSortRule] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [EnumerableSortRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [EnumerableLimitRule] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [EnumerableLimitRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [ProjectRemoveRule] rels
>
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> importance 0.2475
> rule [ProjectMergeRule:force_mode] rels
>
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
>
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> importance 0.2475
> rule [ProjectMergeRule:force_mode] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
>
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> importance 0.2475
> rule [ExpandConversionRule] rels
>
> [rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
> importance 0.2475
> rule [PruneSortLimit0] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [ProjectScanRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> importance 0.2475
> rule [ProjectRemoveRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.2475
> rule [EnumerableSortRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [EnumerableProjectRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.2475
> rule [EnumerableLimitRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> [SortRemoveRule] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#571: Apply
> rule [SortRemoveRule] to
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
> rel#50 via SortRemoveRule
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - call#571: Rule
> SortRemoveRule arguments
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> created rel#50:RelSubset
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#571
> generated 1 successors: [rel#50:Subset#0.ENUMERABLE.[0]]
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 10/8;
> PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> rel#36:Subset#0.ENUMERABLE.[]
> Original rel:
> LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> 0.0 io}, id = 39
>   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> io}, id = 37
>     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> rows, 2.0 cpu, 0.0 io}, id = 33
>
> Sets:
> Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
>     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.2475
>         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
>
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
> rowcount=1.0, cumulative cost={inf}
>
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>     rel#47:Subset#0.NONE.[0], best=null, importance=0.495
>
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>     rel#49:Subset#0.NONE.[], best=null, importance=0.2475
>
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>     rel#50:Subset#0.ENUMERABLE.[0], best=null, importance=0.2475
>
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>
> Importances: { rel#47:Subset#0.NONE.[0]=0.495
> rel#36:Subset#0.ENUMERABLE.[]=1.5E-30
> rel#50:Subset#0.ENUMERABLE.[0]=0.245025}
>
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> rule [SortRemoveConstantKeysRule] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [SortRemoveConstantKeysRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [SortProjectTransposeRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
>
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> importance 0.495
> rule [SortProjectTransposeRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
>
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.495
> rule [PruneSortLimit0] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [PruneSortLimit0] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [ProjectMergeRule:force_mode] rels
>
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
>
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> importance 0.495
> rule [EnumerableSortRule] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [EnumerableSortRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [EnumerableLimitRule] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [EnumerableLimitRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [ProjectRemoveRule] rels
>
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> importance 0.2475
> rule [ProjectMergeRule:force_mode] rels
>
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
>
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> importance 0.2475
> rule [ProjectMergeRule:force_mode] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
>
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> importance 0.2475
> rule [ExpandConversionRule] rels
>
> [rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
> importance 0.2475
> rule [PruneSortLimit0] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [ProjectScanRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> importance 0.2475
> rule [ProjectRemoveRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.2475
> rule [EnumerableSortRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [EnumerableProjectRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.2475
> rule [EnumerableLimitRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> [SortRemoveRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#737: Apply
> rule [SortRemoveRule] to
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
> rel#47 via SortRemoveRule
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - call#737: Rule
> SortRemoveRule arguments
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> created rel#47:RelSubset
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#737
> generated 1 successors: [rel#47:Subset#0.NONE.[0]]
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 11/9;
> PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> rel#36:Subset#0.ENUMERABLE.[]
> Original rel:
> LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> 0.0 io}, id = 39
>   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> io}, id = 37
>     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> rows, 2.0 cpu, 0.0 io}, id = 33
>
> Sets:
> Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
>     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.2475
>         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
>
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
> rowcount=1.0, cumulative cost={inf}
>
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>     rel#47:Subset#0.NONE.[0], best=null, importance=0.495
>
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>     rel#49:Subset#0.NONE.[], best=null, importance=0.2475
>
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>     rel#50:Subset#0.ENUMERABLE.[0], best=null, importance=0.2475
>
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>
> Importances: { rel#47:Subset#0.NONE.[0]=0.495
> rel#36:Subset#0.ENUMERABLE.[]=1.5E-30
> rel#50:Subset#0.ENUMERABLE.[0]=0.245025}
>
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> rule [SortRemoveConstantKeysRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [SortProjectTransposeRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
>
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> importance 0.495
> rule [SortProjectTransposeRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
>
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.495
> rule [PruneSortLimit0] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [PruneSortLimit0] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [ProjectMergeRule:force_mode] rels
>
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
>
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> importance 0.495
> rule [EnumerableSortRule] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [EnumerableSortRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [EnumerableLimitRule] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [EnumerableLimitRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [ProjectRemoveRule] rels
>
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> importance 0.2475
> rule [ProjectMergeRule:force_mode] rels
>
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
>
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> importance 0.2475
> rule [ProjectMergeRule:force_mode] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
>
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> importance 0.2475
> rule [ExpandConversionRule] rels
>
> [rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
> importance 0.2475
> rule [PruneSortLimit0] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [ProjectScanRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> importance 0.2475
> rule [ProjectRemoveRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.2475
> rule [EnumerableSortRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [EnumerableProjectRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.2475
> rule [EnumerableLimitRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> [SortRemoveConstantKeysRule] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#560: Apply
> rule [SortRemoveConstantKeysRule] to
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#560
> generated 0 successors.
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 12/10;
> PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> rel#36:Subset#0.ENUMERABLE.[]
> Original rel:
> LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> 0.0 io}, id = 39
>   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> io}, id = 37
>     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> rows, 2.0 cpu, 0.0 io}, id = 33
>
> Sets:
> Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
>     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.2475
>         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
>
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
> rowcount=1.0, cumulative cost={inf}
>
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>     rel#47:Subset#0.NONE.[0], best=null, importance=0.495
>
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>     rel#49:Subset#0.NONE.[], best=null, importance=0.2475
>
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>     rel#50:Subset#0.ENUMERABLE.[0], best=null, importance=0.2475
>
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>
> Importances: { rel#47:Subset#0.NONE.[0]=0.495
> rel#36:Subset#0.ENUMERABLE.[]=1.5E-30
> rel#50:Subset#0.ENUMERABLE.[0]=0.245025}
>
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> rule [SortProjectTransposeRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
>
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> importance 0.495
> rule [SortProjectTransposeRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
>
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.495
> rule [PruneSortLimit0] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [PruneSortLimit0] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [ProjectMergeRule:force_mode] rels
>
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
>
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> importance 0.495
> rule [EnumerableSortRule] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [EnumerableSortRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [EnumerableLimitRule] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [EnumerableLimitRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [ProjectRemoveRule] rels
>
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> importance 0.2475
> rule [ProjectMergeRule:force_mode] rels
>
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
>
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> importance 0.2475
> rule [ProjectMergeRule:force_mode] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
>
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> importance 0.2475
> rule [ExpandConversionRule] rels
>
> [rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
> importance 0.2475
> rule [PruneSortLimit0] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [ProjectScanRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> importance 0.2475
> rule [ProjectRemoveRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.2475
> rule [EnumerableSortRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [EnumerableProjectRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.2475
> rule [EnumerableLimitRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
> [SortRemoveConstantKeysRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#724: Apply
> rule [SortRemoveConstantKeysRule] to
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#724
> generated 0 successors.
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
> org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 13/11;
> PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
> rel#36:Subset#0.ENUMERABLE.[]
> Original rel:
> LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
> dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
> 0.0 io}, id = 39
>   LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
> s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
> io}, id = 37
>     EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
> table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
> rows, 2.0 cpu, 0.0 io}, id = 33
>
> Sets:
> Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
>     rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.2475
>         rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
> tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
>
> rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
> rowcount=1.0, cumulative cost={inf}
>
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>     rel#47:Subset#0.NONE.[0], best=null, importance=0.495
>
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>     rel#49:Subset#0.NONE.[], best=null, importance=0.2475
>
> rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>
> rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
> rowcount=1.0, cumulative cost={inf}
>
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>     rel#50:Subset#0.ENUMERABLE.[0], best=null, importance=0.2475
>
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
> rowcount=1.0, cumulative cost={inf}
>
> Importances: { rel#47:Subset#0.NONE.[0]=0.495
> rel#36:Subset#0.ENUMERABLE.[]=1.5E-30
> rel#50:Subset#0.ENUMERABLE.[0]=0.245025}
>
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> rule [SortProjectTransposeRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
>
> rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.495
> rule [PruneSortLimit0] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [PruneSortLimit0] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [ProjectMergeRule:force_mode] rels
>
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
>
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> importance 0.495
> rule [EnumerableSortRule] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [EnumerableSortRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [EnumerableLimitRule] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [EnumerableLimitRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [ProjectRemoveRule] rels
>
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> importance 0.2475
> rule [ProjectMergeRule:force_mode] rels
>
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
>
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> importance 0.2475
> rule [ProjectMergeRule:force_mode] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
>
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> importance 0.2475
> rule [ExpandConversionRule] rels
>
> [rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
> importance 0.2475
> rule [PruneSortLimit0] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [ProjectScanRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> importance 0.2475
> rule [ProjectRemoveRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.2475
> rule [EnumerableSortRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [EnumerableProjectRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.2475
> rule [EnumerableLimitRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> [main] DEBUG org.apache.calcite.plan.RelOptPlanner - Skip match: rule
> [SortProjectTransposeRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
>
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> [main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
> rule [PruneSortLimit0] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [PruneSortLimit0] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [ProjectMergeRule:force_mode] rels
>
> [rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
>
> rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
> importance 0.495
> rule [EnumerableSortRule] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [EnumerableSortRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [EnumerableLimitRule] rels
>
> [rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [EnumerableLimitRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [ProjectRemoveRule] rels
>
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> importance 0.2475
> rule [ProjectMergeRule:force_mode] rels
>
> [rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
>
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> importance 0.2475
> rule [ProjectMergeRule:force_mode] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
>
> rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
> importance 0.2475
> rule [ExpandConversionRule] rels
>
> [rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
> importance 0.2475
> rule [PruneSortLimit0] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> rule [ProjectScanRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
> rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
> importance 0.2475
> rule [ProjectRemoveRule] rels
>
> [rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
> importance 0.2475
> rule [EnumerableSortRule] rels
>
> [rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
> importance 0.495
> r

Re: Help with EnumerableMergeJoinRule which is losing a RelCollection trait

Posted by Enrico Olivelli <eo...@gmail.com>.
Sorry  in advance for this very long email....
I am trying to debug, but I honestly I did not undestand clearly how
these rules work

I have this query:
SELECT `tsql`.`k1`, `tsql`.`n1`, `tsql`.`s1`
FROM `tblspace1`.`tsql` AS `TSQL`

This is the table:
CREATE TABLE tblspace1.tsql (k1 string primary key,n1 int,s1 string)

Logical Plan Starts with:
LogicalSort(sort0=[$0], dir0=[ASC])
  LogicalProject(k1=[$0], n1=[$1], s1=[$2])
    LogicalTableScan(table=[[tblspace1, tsql]])

And the Best Exp eventually is:
EnumerableTableScan(table=[[tblspace1, tsql]]): rowcount = 1.0,
cumulative cost = {1.0 rows, 2.0 cpu, 0.0 io}, id = 33

The problem is that the Sort disappears.
The Table is configured with Statistics without any Collation
Statistics.of(tableManager.getStats().getTablesize(), keys)

This happens if I enable these traits on the Planner:
ConventionTraitDef.INSTANCE, RelCollationTraitDef.INSTANCE

if I enable only ConventionTraitDef the sort does not disappear

These are "TRACE" level logs of the Planner

Maybe some expert of you can see inside the logs the anwer to my problem.

Thank you in advace, I know that your time is valuable. I appreciate
any kind of help

Enrico


[main] TRACE org.apache.calcite.sql.parser - After validation: SELECT
`tsql`.`k1`, `tsql`.`n1`, `tsql`.`s1`
FROM `tblspace1`.`tsql` AS `TSQL`
ORDER BY `K1`
[main] TRACE org.apache.calcite.plan.RelOptPlanner - new LogicalTableScan#30
[main] TRACE org.apache.calcite.plan.RelOptPlanner - new LogicalProject#31
[main] TRACE org.apache.calcite.plan.RelOptPlanner - new LogicalSort#32
[main] DEBUG org.apache.calcite.sql2rel - Plan after converting
SqlNode to RelNode
LogicalSort(sort0=[$0], dir0=[ASC])
  LogicalProject(k1=[$0], n1=[$1], s1=[$2])
    LogicalTableScan(table=[[tblspace1, tsql]])

[main] TRACE org.apache.calcite.plan.RelOptPlanner - new EnumerableTableScan#33
[main] TRACE org.apache.calcite.plan.RelOptPlanner - new LogicalProject#34
[main] TRACE org.apache.calcite.plan.RelOptPlanner - new LogicalSort#35
Query: select * from tblspace1.tsql order by k1
-- Best  Plan
LogicalSort(sort0=[$0], dir0=[ASC]): rowcount = 1.0, cumulative cost =
{3.0 rows, 17.0 cpu, 0.0 io}, id = 35
  LogicalProject(k1=[$0], n1=[$1], s1=[$2]): rowcount = 1.0,
cumulative cost = {2.0 rows, 5.0 cpu, 0.0 io}, id = 34
    EnumerableTableScan(table=[[tblspace1, tsql]]): rowcount = 1.0,
cumulative cost = {1.0 rows, 2.0 cpu, 0.0 io}, id = 33

[main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#36
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Subset cost
improved: subset [rel#36:Subset#0.ENUMERABLE.[]] cost was {inf} now
{1.0 rows, 2.0 cpu, 0.0 io}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql]) in
rel#36:Subset#0.ENUMERABLE.[]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
[rel#36:Subset#0.ENUMERABLE.[]] is 0.0
[main] TRACE org.apache.calcite.plan.RelOptPlanner - new LogicalProject#37
[main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#38
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)
in rel#38:Subset#1.NONE.[]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
[rel#36:Subset#0.ENUMERABLE.[]] to its parent
[rel#38:Subset#1.NONE.[]] is 0.0 (parent importance=0.0, child
cost=3.0, parent cost=1.0E30)
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
[rel#36:Subset#0.ENUMERABLE.[]] is 0.0
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
[rel#38:Subset#1.NONE.[]] is 0.0
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [ProjectRemoveRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [ProjectScanRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - new LogicalSort#39
[main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#40
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)
in rel#40:Subset#2.NONE.[0]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
[rel#38:Subset#1.NONE.[]] to its parent [rel#40:Subset#2.NONE.[0]] is
0.0 (parent importance=0.0, child cost=1.0E30, parent cost=1.0E30)
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
[rel#38:Subset#1.NONE.[]] is 0.0
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
[rel#40:Subset#2.NONE.[0]] is 0.0
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [SortRemoveConstantKeysRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [SortProjectTransposeRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [SortRemoveRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#41
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 1/1;
PHASE = PRE_PROCESS_MDR; COST = {inf}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#41:Subset#2.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.0
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#38:Subset#1.NONE.[], best=null, importance=0.0
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
Set#2, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#40:Subset#2.NONE.[0], best=null, importance=0.0
        rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
    rel#41:Subset#2.ENUMERABLE.[], best=null, importance=0.0

Importances: { rel#36:Subset#0.ENUMERABLE.[]=0.0
rel#38:Subset#1.NONE.[]=0.0 rel#40:Subset#2.NONE.[0]=0.0}

[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 2/1;
PHASE = PRE_PROCESS; COST = {inf}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#41:Subset#2.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.0
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#38:Subset#1.NONE.[], best=null, importance=0.0
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
Set#2, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#40:Subset#2.NONE.[0], best=null, importance=0.0
        rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
    rel#41:Subset#2.ENUMERABLE.[], best=null, importance=0.0

Importances: { rel#36:Subset#0.ENUMERABLE.[]=0.0
rel#38:Subset#1.NONE.[]=0.0 rel#40:Subset#2.NONE.[0]=0.0}

[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 3/1;
PHASE = OPTIMIZE; COST = {inf}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#41:Subset#2.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.0
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#38:Subset#1.NONE.[], best=null, importance=0.0
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
Set#2, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#40:Subset#2.NONE.[0], best=null, importance=0.0
        rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
    rel#41:Subset#2.ENUMERABLE.[], best=null, importance=0.0

Importances: { rel#36:Subset#0.ENUMERABLE.[]=0.0
rel#38:Subset#1.NONE.[]=0.0 rel#40:Subset#2.NONE.[0]=0.0}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [SortRemoveConstantKeysRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.0
rule [SortProjectTransposeRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.0
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.0
rule [ProjectScanRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
importance 0.0
rule [ProjectRemoveRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.0
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.0
rule [EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.0
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.0
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
[SortRemoveRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#446: Apply
rule [SortRemoveRule] to
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#42
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
rel#42 via SortRemoveRule
[main] TRACE org.apache.calcite.plan.RelOptPlanner - call#446: Rule
SortRemoveRule arguments
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
created rel#42:RelSubset
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Merge set#2 into set#1
[main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#43
[main] TRACE org.apache.calcite.plan.RelOptPlanner - new AbstractConverter#44
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[])
in rel#43:Subset#1.ENUMERABLE.[]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
[rel#38:Subset#1.NONE.[]] to its parent [rel#42:Subset#1.NONE.[0]] is
0.0 (parent importance=0.0, child cost=1.0E30, parent cost=1.0E30)
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
[rel#38:Subset#1.NONE.[]] to its parent
[rel#43:Subset#1.ENUMERABLE.[]] is 0.0 (parent importance=0.0, child
cost=1.0E30, parent cost=1.0E30)
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
[rel#38:Subset#1.NONE.[]] is 0.0
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
[rel#43:Subset#1.ENUMERABLE.[]] is 1.0
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [ExpandConversionRule] rels
[rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[])]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#446
generated 1 successors: [rel#42:Subset#1.NONE.[0]]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 4/2;
PHASE = OPTIMIZE; COST = {inf}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#43:Subset#1.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.0
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#38:Subset#1.NONE.[], best=null, importance=0.5
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
    rel#42:Subset#1.NONE.[0], best=null, importance=0.5
        rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
    rel#43:Subset#1.ENUMERABLE.[], best=null, importance=1.0
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}

Importances: { rel#43:Subset#1.ENUMERABLE.[]=1.0
rel#38:Subset#1.NONE.[]=0.0 rel#36:Subset#0.ENUMERABLE.[]=0.0}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [SortRemoveConstantKeysRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [SortProjectTransposeRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [ProjectScanRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
importance 0.5
rule [ProjectRemoveRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
[ExpandConversionRule] rels
[rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[])]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#550: Apply
rule [ExpandConversionRule] to
[rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[])]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#550
generated 0 successors.
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 5/3;
PHASE = OPTIMIZE; COST = {inf}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#43:Subset#1.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.0
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#38:Subset#1.NONE.[], best=null, importance=0.5
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
    rel#42:Subset#1.NONE.[0], best=null, importance=0.5
        rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
    rel#43:Subset#1.ENUMERABLE.[], best=null, importance=1.0
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}

Importances: { rel#43:Subset#1.ENUMERABLE.[]=1.0
rel#38:Subset#1.NONE.[]=0.0 rel#36:Subset#0.ENUMERABLE.[]=0.0}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [SortProjectTransposeRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [ProjectScanRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
importance 0.5
rule [ProjectRemoveRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
[SortRemoveConstantKeysRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#434: Apply
rule [SortRemoveConstantKeysRule] to
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#434
generated 0 successors.
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 6/4;
PHASE = OPTIMIZE; COST = {inf}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#43:Subset#1.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.0
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#38:Subset#1.NONE.[], best=null, importance=0.5
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
    rel#42:Subset#1.NONE.[0], best=null, importance=0.5
        rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
    rel#43:Subset#1.ENUMERABLE.[], best=null, importance=1.0
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}

Importances: { rel#43:Subset#1.ENUMERABLE.[]=1.0
rel#38:Subset#1.NONE.[]=0.0 rel#36:Subset#0.ENUMERABLE.[]=0.0}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [ProjectScanRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
importance 0.5
rule [ProjectRemoveRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
[SortProjectTransposeRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#444: Apply
rule [SortProjectTransposeRule] to
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - new LogicalSort#45
[main] TRACE org.apache.calcite.plan.RelOptPlanner - new LogicalProject#46
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
rel#46 via SortProjectTransposeRule with equivalences
{LogicalSort#45=rel#36:Subset#0.ENUMERABLE.[]}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - call#444: Rule
SortProjectTransposeRule arguments
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
created rel#46:LogicalProject
[main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#47
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)
in rel#47:Subset#0.NONE.[0]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
[rel#36:Subset#0.ENUMERABLE.[]] to its parent
[rel#38:Subset#1.NONE.[]] is 1.5E-30 (parent importance=0.5, child
cost=3.0, parent cost=1.0E30)
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
[rel#36:Subset#0.ENUMERABLE.[]] to its parent
[rel#47:Subset#0.NONE.[0]] is 0.0 (parent importance=0.0, child
cost=3.0, parent cost=1.0E30)
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
[rel#36:Subset#0.ENUMERABLE.[]] is 1.5E-30
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
[rel#47:Subset#0.NONE.[0]] is 0.0
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [SortRemoveConstantKeysRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [PruneSortLimit0] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [EnumerableSortRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [SortRemoveRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [EnumerableLimitRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - new LogicalProject#48
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)
in rel#42:Subset#1.NONE.[0]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
[rel#47:Subset#0.NONE.[0]] to its parent [rel#42:Subset#1.NONE.[0]] is
0.495 (parent importance=0.5, child cost=1.0E30, parent cost=1.0E30)
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
[rel#47:Subset#0.NONE.[0]] is 0.495
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
[rel#42:Subset#1.NONE.[0]] is 0.0
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [EnumerableProjectRule] rels
[rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [ProjectRemoveRule] rels
[rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [SortProjectTransposeRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#444
generated 1 successors: [LogicalProject#46]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 7/5;
PHASE = OPTIMIZE; COST = {inf}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#43:Subset#1.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.2475
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
    rel#47:Subset#0.NONE.[0], best=null, importance=0.495
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
Set#1, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#38:Subset#1.NONE.[], best=null, importance=0.5
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#42:Subset#1.NONE.[0], best=null, importance=0.5
        rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#43:Subset#1.ENUMERABLE.[], best=null, importance=1.0
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}

Importances: { rel#43:Subset#1.ENUMERABLE.[]=1.0
rel#38:Subset#1.NONE.[]=0.0 rel#42:Subset#1.NONE.[0]=0.0
rel#47:Subset#0.NONE.[0]=0.495 rel#36:Subset#0.ENUMERABLE.[]=1.5E-30}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [ProjectRemoveRule] rels
[rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableProjectRule] rels
[rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [SortRemoveRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [SortRemoveConstantKeysRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [PruneSortLimit0] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableSortRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableLimitRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [ProjectScanRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
importance 0.5
rule [ProjectRemoveRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Skip match: rule
[SortProjectTransposeRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC),
rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [EnumerableProjectRule] rels
[rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [SortRemoveRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [SortRemoveConstantKeysRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [PruneSortLimit0] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableSortRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableLimitRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [ProjectScanRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
importance 0.5
rule [ProjectRemoveRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
[ProjectRemoveRule] rels
[rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#617: Apply
rule [ProjectRemoveRule] to
[rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Register #47
rel#47:Subset#0.NONE.[0], and merge sets
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Merge set#1 into set#0
[main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#49
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Rename #39 from
'LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)'
to 'LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)'
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Rename #44 from
'AbstractConverter.ENUMERABLE.[](input=rel#38:Subset#1.NONE.[],convention=ENUMERABLE,sort=[])'
to 'AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])'
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [SortProjectTransposeRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [SortRemoveConstantKeysRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [SortProjectTransposeRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [SortRemoveRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [ProjectMergeRule:force_mode] rels
[rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [ExpandConversionRule] rels
[rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
rel#47 via ProjectRemoveRule
[main] TRACE org.apache.calcite.plan.RelOptPlanner - call#617: Rule
ProjectRemoveRule arguments
[rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
created rel#47:RelSubset
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#617
generated 1 successors: [rel#47:Subset#0.NONE.[0]]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - boostImportance(1.0, [])
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 8/6;
PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#36:Subset#0.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.2475
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}
    rel#47:Subset#0.NONE.[0], best=null, importance=0.495
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#49:Subset#0.NONE.[], best=null, importance=0.2475
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}

Importances: { rel#47:Subset#0.NONE.[0]=0.495
rel#36:Subset#0.ENUMERABLE.[]=1.5E-30}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [SortRemoveRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [SortRemoveRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [SortRemoveConstantKeysRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [SortRemoveConstantKeysRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [SortProjectTransposeRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.495
rule [SortProjectTransposeRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.495
rule [PruneSortLimit0] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [ProjectMergeRule:force_mode] rels
[rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.495
rule [EnumerableSortRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableLimitRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [ExpandConversionRule] rels
[rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
importance 0.2475
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [ProjectScanRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
importance 0.2475
rule [ProjectRemoveRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
[EnumerableProjectRule] rels
[rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#615: Apply
rule [EnumerableProjectRule] to
[rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - new RelSubset#50
[main] TRACE org.apache.calcite.plan.RelOptPlanner - new EnumerableProject#51
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
rel#51 via EnumerableProjectRule
[main] TRACE org.apache.calcite.plan.RelOptPlanner - call#615: Rule
EnumerableProjectRule arguments
[rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
created rel#51:EnumerableProject
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)
in rel#50:Subset#0.ENUMERABLE.[0]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
[rel#50:Subset#0.ENUMERABLE.[0]] to its parent
[rel#50:Subset#0.ENUMERABLE.[0]] is 0.245025 (parent
importance=0.2475, child cost=1.0E30, parent cost=1.0E30)
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
[rel#50:Subset#0.ENUMERABLE.[0]] is 0.245025
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [ProjectMergeRule:force_mode] rels
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [ProjectMergeRule:force_mode] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [ProjectRemoveRule] rels
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#615
generated 1 successors:
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 9/7;
PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#36:Subset#0.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.2475
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#47:Subset#0.NONE.[0], best=null, importance=0.495
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#49:Subset#0.NONE.[], best=null, importance=0.2475
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#50:Subset#0.ENUMERABLE.[0], best=null, importance=0.2475
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}

Importances: { rel#47:Subset#0.NONE.[0]=0.495
rel#36:Subset#0.ENUMERABLE.[]=1.5E-30
rel#50:Subset#0.ENUMERABLE.[0]=0.245025}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [SortRemoveRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [SortRemoveConstantKeysRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [SortRemoveConstantKeysRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [SortProjectTransposeRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.495
rule [SortProjectTransposeRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.495
rule [PruneSortLimit0] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [ProjectMergeRule:force_mode] rels
[rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.495
rule [EnumerableSortRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableLimitRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [ProjectRemoveRule] rels
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [ProjectMergeRule:force_mode] rels
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [ProjectMergeRule:force_mode] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [ExpandConversionRule] rels
[rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
importance 0.2475
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [ProjectScanRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
importance 0.2475
rule [ProjectRemoveRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
[SortRemoveRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#571: Apply
rule [SortRemoveRule] to
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
rel#50 via SortRemoveRule
[main] TRACE org.apache.calcite.plan.RelOptPlanner - call#571: Rule
SortRemoveRule arguments
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
created rel#50:RelSubset
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#571
generated 1 successors: [rel#50:Subset#0.ENUMERABLE.[0]]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 10/8;
PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#36:Subset#0.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.2475
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#47:Subset#0.NONE.[0], best=null, importance=0.495
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#49:Subset#0.NONE.[], best=null, importance=0.2475
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#50:Subset#0.ENUMERABLE.[0], best=null, importance=0.2475
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}

Importances: { rel#47:Subset#0.NONE.[0]=0.495
rel#36:Subset#0.ENUMERABLE.[]=1.5E-30
rel#50:Subset#0.ENUMERABLE.[0]=0.245025}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [SortRemoveConstantKeysRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [SortRemoveConstantKeysRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [SortProjectTransposeRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.495
rule [SortProjectTransposeRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.495
rule [PruneSortLimit0] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [ProjectMergeRule:force_mode] rels
[rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.495
rule [EnumerableSortRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableLimitRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [ProjectRemoveRule] rels
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [ProjectMergeRule:force_mode] rels
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [ProjectMergeRule:force_mode] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [ExpandConversionRule] rels
[rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
importance 0.2475
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [ProjectScanRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
importance 0.2475
rule [ProjectRemoveRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
[SortRemoveRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#737: Apply
rule [SortRemoveRule] to
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
rel#47 via SortRemoveRule
[main] TRACE org.apache.calcite.plan.RelOptPlanner - call#737: Rule
SortRemoveRule arguments
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
created rel#47:RelSubset
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#737
generated 1 successors: [rel#47:Subset#0.NONE.[0]]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 11/9;
PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#36:Subset#0.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.2475
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#47:Subset#0.NONE.[0], best=null, importance=0.495
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#49:Subset#0.NONE.[], best=null, importance=0.2475
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#50:Subset#0.ENUMERABLE.[0], best=null, importance=0.2475
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}

Importances: { rel#47:Subset#0.NONE.[0]=0.495
rel#36:Subset#0.ENUMERABLE.[]=1.5E-30
rel#50:Subset#0.ENUMERABLE.[0]=0.245025}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [SortRemoveConstantKeysRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [SortProjectTransposeRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.495
rule [SortProjectTransposeRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.495
rule [PruneSortLimit0] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [ProjectMergeRule:force_mode] rels
[rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.495
rule [EnumerableSortRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableLimitRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [ProjectRemoveRule] rels
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [ProjectMergeRule:force_mode] rels
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [ProjectMergeRule:force_mode] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [ExpandConversionRule] rels
[rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
importance 0.2475
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [ProjectScanRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
importance 0.2475
rule [ProjectRemoveRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
[SortRemoveConstantKeysRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#560: Apply
rule [SortRemoveConstantKeysRule] to
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#560
generated 0 successors.
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 12/10;
PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#36:Subset#0.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.2475
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#47:Subset#0.NONE.[0], best=null, importance=0.495
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#49:Subset#0.NONE.[], best=null, importance=0.2475
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#50:Subset#0.ENUMERABLE.[0], best=null, importance=0.2475
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}

Importances: { rel#47:Subset#0.NONE.[0]=0.495
rel#36:Subset#0.ENUMERABLE.[]=1.5E-30
rel#50:Subset#0.ENUMERABLE.[0]=0.245025}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [SortProjectTransposeRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.495
rule [SortProjectTransposeRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.495
rule [PruneSortLimit0] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [ProjectMergeRule:force_mode] rels
[rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.495
rule [EnumerableSortRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableLimitRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [ProjectRemoveRule] rels
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [ProjectMergeRule:force_mode] rels
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [ProjectMergeRule:force_mode] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [ExpandConversionRule] rels
[rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
importance 0.2475
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [ProjectScanRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
importance 0.2475
rule [ProjectRemoveRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
[SortRemoveConstantKeysRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#724: Apply
rule [SortRemoveConstantKeysRule] to
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#724
generated 0 successors.
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 13/11;
PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#36:Subset#0.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.2475
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#47:Subset#0.NONE.[0], best=null, importance=0.495
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#49:Subset#0.NONE.[], best=null, importance=0.2475
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#50:Subset#0.ENUMERABLE.[0], best=null, importance=0.2475
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}

Importances: { rel#47:Subset#0.NONE.[0]=0.495
rel#36:Subset#0.ENUMERABLE.[]=1.5E-30
rel#50:Subset#0.ENUMERABLE.[0]=0.245025}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [SortProjectTransposeRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.495
rule [PruneSortLimit0] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [ProjectMergeRule:force_mode] rels
[rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.495
rule [EnumerableSortRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableLimitRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [ProjectRemoveRule] rels
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [ProjectMergeRule:force_mode] rels
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [ProjectMergeRule:force_mode] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [ExpandConversionRule] rels
[rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
importance 0.2475
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [ProjectScanRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
importance 0.2475
rule [ProjectRemoveRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Skip match: rule
[SortProjectTransposeRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [PruneSortLimit0] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [ProjectMergeRule:force_mode] rels
[rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.495
rule [EnumerableSortRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableLimitRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [ProjectRemoveRule] rels
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [ProjectMergeRule:force_mode] rels
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [ProjectMergeRule:force_mode] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [ExpandConversionRule] rels
[rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
importance 0.2475
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [ProjectScanRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
importance 0.2475
rule [ProjectRemoveRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
[SortProjectTransposeRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#708: Apply
rule [SortProjectTransposeRule] to
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - new LogicalSort#52
[main] TRACE org.apache.calcite.plan.RelOptPlanner - new LogicalProject#53
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
rel#53 via SortProjectTransposeRule with equivalences
{LogicalSort#52=rel#36:Subset#0.ENUMERABLE.[]}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - call#708: Rule
SortProjectTransposeRule arguments
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
created rel#53:LogicalProject
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Register: rel#52
is equivalent to
rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Register: rel#52
is equivalent to
rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)
[main] TRACE org.apache.calcite.plan.RelOptPlanner - new LogicalProject#54
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Register: rel#54
is equivalent to
rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#708
generated 1 successors: [LogicalProject#53]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 14/12;
PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#36:Subset#0.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.2475
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#47:Subset#0.NONE.[0], best=null, importance=0.495
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#49:Subset#0.NONE.[], best=null, importance=0.2475
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#50:Subset#0.ENUMERABLE.[0], best=null, importance=0.2475
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}

Importances: { rel#47:Subset#0.NONE.[0]=0.495
rel#36:Subset#0.ENUMERABLE.[]=1.5E-30
rel#50:Subset#0.ENUMERABLE.[0]=0.245025}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [ProjectMergeRule:force_mode] rels
[rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.495
rule [EnumerableSortRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableLimitRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [ProjectRemoveRule] rels
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [ProjectMergeRule:force_mode] rels
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [ProjectMergeRule:force_mode] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [ExpandConversionRule] rels
[rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
importance 0.2475
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [ProjectScanRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
importance 0.2475
rule [ProjectRemoveRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
[PruneSortLimit0] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#566: Apply
rule [PruneSortLimit0] to
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#566
generated 0 successors.
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 15/13;
PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#36:Subset#0.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.2475
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#47:Subset#0.NONE.[0], best=null, importance=0.495
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#49:Subset#0.NONE.[], best=null, importance=0.2475
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#50:Subset#0.ENUMERABLE.[0], best=null, importance=0.2475
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}

Importances: { rel#47:Subset#0.NONE.[0]=0.495
rel#36:Subset#0.ENUMERABLE.[]=1.5E-30
rel#50:Subset#0.ENUMERABLE.[0]=0.245025}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [ProjectMergeRule:force_mode] rels
[rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.495
rule [EnumerableSortRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableLimitRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [ProjectRemoveRule] rels
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [ProjectMergeRule:force_mode] rels
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [ProjectMergeRule:force_mode] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [ExpandConversionRule] rels
[rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
importance 0.2475
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [ProjectScanRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
importance 0.2475
rule [ProjectRemoveRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
[PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#730: Apply
rule [PruneSortLimit0] to
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#730
generated 0 successors.
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 16/14;
PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#36:Subset#0.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=0.2475
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#47:Subset#0.NONE.[0], best=null, importance=0.495
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#49:Subset#0.NONE.[], best=null, importance=0.2475
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#50:Subset#0.ENUMERABLE.[0], best=null, importance=0.2475
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}

Importances: { rel#47:Subset#0.NONE.[0]=0.495
rel#36:Subset#0.ENUMERABLE.[]=1.5E-30
rel#50:Subset#0.ENUMERABLE.[0]=0.245025}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [EnumerableSortRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableLimitRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [ProjectRemoveRule] rels
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [ProjectMergeRule:force_mode] rels
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [ProjectMergeRule:force_mode] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [ExpandConversionRule] rels
[rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
importance 0.2475
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [ProjectScanRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
importance 0.2475
rule [ProjectRemoveRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Skip match: rule
[ProjectMergeRule:force_mode] rels
[rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableLimitRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [ProjectRemoveRule] rels
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [ProjectMergeRule:force_mode] rels
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [ProjectMergeRule:force_mode] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [ExpandConversionRule] rels
[rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
importance 0.2475
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [ProjectScanRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
importance 0.2475
rule [ProjectRemoveRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
rule [EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.2475
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.495
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
[EnumerableSortRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#568: Apply
rule [EnumerableSortRule] to
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - new EnumerableSort#55
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
rel#55 via EnumerableSortRule
[main] TRACE org.apache.calcite.plan.RelOptPlanner - call#568: Rule
EnumerableSortRule arguments
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
created rel#55:EnumerableSort
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Subset cost
improved: subset [rel#50:Subset#0.ENUMERABLE.[0]] cost was {inf} now
{2.0 rows, 14.0 cpu, 0.0 io}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
[rel#50:Subset#0.ENUMERABLE.[0]] to its parent
[rel#50:Subset#0.ENUMERABLE.[0]] is 0.245025 (parent
importance=0.2475, child cost=16.0, parent cost=16.0)
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
[rel#50:Subset#0.ENUMERABLE.[0]] is 0.245025
[main] TRACE org.apache.calcite.plan.RelOptPlanner - cyclic:
rel#50:Subset#0.ENUMERABLE.[0]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)
in rel#50:Subset#0.ENUMERABLE.[0]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
[rel#36:Subset#0.ENUMERABLE.[]] is 1.0
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
[rel#50:Subset#0.ENUMERABLE.[0]] to its parent
[rel#50:Subset#0.ENUMERABLE.[0]] is 0.495 (parent importance=0.5,
child cost=16.0, parent cost=16.0)
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
[rel#50:Subset#0.ENUMERABLE.[0]] is 0.495
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [SortRemoveConstantKeysRule] rels
[rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [PruneSortLimit0] rels
[rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [SortRemoveRule] rels
[rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [EnumerableLimitRule] rels
[rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#568
generated 1 successors:
[rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 17/15;
PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#36:Subset#0.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=1.0
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}
    rel#47:Subset#0.NONE.[0], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#49:Subset#0.NONE.[], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#50:Subset#0.ENUMERABLE.[0], best=rel#55, importance=0.5
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}

Importances: { rel#36:Subset#0.ENUMERABLE.[]=1.0
rel#47:Subset#0.NONE.[0]=0.495 rel#50:Subset#0.ENUMERABLE.[0]=0.495}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [SortRemoveRule] rels
[rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [SortRemoveConstantKeysRule] rels
[rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [PruneSortLimit0] rels
[rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [ProjectRemoveRule] rels
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [ProjectMergeRule:force_mode] rels
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [ProjectMergeRule:force_mode] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [ProjectScanRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
importance 0.5
rule [ProjectRemoveRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
[ExpandConversionRule] rels
[rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#798: Apply
rule [ExpandConversionRule] to
[rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[])]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#798
generated 0 successors.
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 18/16;
PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#36:Subset#0.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=1.0
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}
    rel#47:Subset#0.NONE.[0], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#49:Subset#0.NONE.[], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#50:Subset#0.ENUMERABLE.[0], best=rel#55, importance=0.5
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}

Importances: { rel#36:Subset#0.ENUMERABLE.[]=1.0
rel#47:Subset#0.NONE.[0]=0.495 rel#50:Subset#0.ENUMERABLE.[0]=0.495}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [SortRemoveConstantKeysRule] rels
[rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [PruneSortLimit0] rels
[rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [ProjectRemoveRule] rels
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [ProjectMergeRule:force_mode] rels
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [ProjectMergeRule:force_mode] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [ProjectScanRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
importance 0.5
rule [ProjectRemoveRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
[SortRemoveRule] rels
[rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#848: Apply
rule [SortRemoveRule] to
[rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
rel#50 via SortRemoveRule
[main] TRACE org.apache.calcite.plan.RelOptPlanner - call#848: Rule
SortRemoveRule arguments
[rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
created rel#50:RelSubset
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#848
generated 1 successors: [rel#50:Subset#0.ENUMERABLE.[0]]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 19/17;
PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#36:Subset#0.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=1.0
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}
    rel#47:Subset#0.NONE.[0], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#49:Subset#0.NONE.[], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#50:Subset#0.ENUMERABLE.[0], best=rel#55, importance=0.5
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}

Importances: { rel#36:Subset#0.ENUMERABLE.[]=1.0
rel#47:Subset#0.NONE.[0]=0.495 rel#50:Subset#0.ENUMERABLE.[0]=0.495}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [PruneSortLimit0] rels
[rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [ProjectRemoveRule] rels
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [ProjectMergeRule:force_mode] rels
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [ProjectMergeRule:force_mode] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [ProjectScanRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
importance 0.5
rule [ProjectRemoveRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
[SortRemoveConstantKeysRule] rels
[rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#839: Apply
rule [SortRemoveConstantKeysRule] to
[rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#839
generated 0 successors.
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 20/18;
PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#36:Subset#0.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=1.0
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}
    rel#47:Subset#0.NONE.[0], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#49:Subset#0.NONE.[], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#50:Subset#0.ENUMERABLE.[0], best=rel#55, importance=0.5
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}

Importances: { rel#36:Subset#0.ENUMERABLE.[]=1.0
rel#47:Subset#0.NONE.[0]=0.495 rel#50:Subset#0.ENUMERABLE.[0]=0.495}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [ProjectRemoveRule] rels
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [ProjectMergeRule:force_mode] rels
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [ProjectMergeRule:force_mode] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [ProjectScanRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
importance 0.5
rule [ProjectRemoveRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
[PruneSortLimit0] rels
[rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#845: Apply
rule [PruneSortLimit0] to
[rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#845
generated 0 successors.
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 21/19;
PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#36:Subset#0.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=1.0
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}
    rel#47:Subset#0.NONE.[0], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#49:Subset#0.NONE.[], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#50:Subset#0.ENUMERABLE.[0], best=rel#55, importance=0.5
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}

Importances: { rel#36:Subset#0.ENUMERABLE.[]=1.0
rel#47:Subset#0.NONE.[0]=0.495 rel#50:Subset#0.ENUMERABLE.[0]=0.495}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [ProjectMergeRule:force_mode] rels
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [ProjectMergeRule:force_mode] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [ProjectScanRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
importance 0.5
rule [ProjectRemoveRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
[ProjectRemoveRule] rels
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#822: Apply
rule [ProjectRemoveRule] to
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
rel#50 via ProjectRemoveRule
[main] TRACE org.apache.calcite.plan.RelOptPlanner - call#822: Rule
ProjectRemoveRule arguments
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
created rel#50:RelSubset
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#822
generated 1 successors: [rel#50:Subset#0.ENUMERABLE.[0]]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 22/20;
PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#36:Subset#0.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=1.0
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}
    rel#47:Subset#0.NONE.[0], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#49:Subset#0.NONE.[], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#50:Subset#0.ENUMERABLE.[0], best=rel#55, importance=0.5
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}

Importances: { rel#36:Subset#0.ENUMERABLE.[]=1.0
rel#47:Subset#0.NONE.[0]=0.495 rel#50:Subset#0.ENUMERABLE.[0]=0.495}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [EnumerableLimitRule] rels
[rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [ProjectMergeRule:force_mode] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [ProjectScanRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
importance 0.5
rule [ProjectRemoveRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Skip match: rule
[ProjectMergeRule:force_mode] rels
[rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [ProjectMergeRule:force_mode] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [ProjectScanRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
importance 0.5
rule [ProjectRemoveRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
[EnumerableLimitRule] rels
[rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#856: Apply
rule [EnumerableLimitRule] to
[rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#856
generated 0 successors.
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 23/21;
PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#36:Subset#0.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=1.0
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}
    rel#47:Subset#0.NONE.[0], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#49:Subset#0.NONE.[], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#50:Subset#0.ENUMERABLE.[0], best=rel#55, importance=0.5
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}

Importances: { rel#36:Subset#0.ENUMERABLE.[]=1.0
rel#47:Subset#0.NONE.[0]=0.495 rel#50:Subset#0.ENUMERABLE.[0]=0.495}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [EnumerableLimitRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [ProjectMergeRule:force_mode] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [ProjectScanRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
importance 0.5
rule [ProjectRemoveRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
[EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#732: Apply
rule [EnumerableSortRule] to
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - new EnumerableSort#56
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
rel#56 via EnumerableSortRule
[main] TRACE org.apache.calcite.plan.RelOptPlanner - call#732: Rule
EnumerableSortRule arguments
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
created rel#56:EnumerableSort
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Register: rel#56
is equivalent to
rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#732
generated 1 successors:
[rel#56:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 24/22;
PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#36:Subset#0.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=1.0
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}
    rel#47:Subset#0.NONE.[0], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#49:Subset#0.NONE.[], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#50:Subset#0.ENUMERABLE.[0], best=rel#55, importance=0.5
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}

Importances: { rel#36:Subset#0.ENUMERABLE.[]=1.0
rel#47:Subset#0.NONE.[0]=0.495 rel#50:Subset#0.ENUMERABLE.[0]=0.495}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [ProjectMergeRule:force_mode] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [ProjectScanRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
importance 0.5
rule [ProjectRemoveRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
[EnumerableLimitRule] rels
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#579: Apply
rule [EnumerableLimitRule] to
[rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#579
generated 0 successors.
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 25/23;
PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#36:Subset#0.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=1.0
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}
    rel#47:Subset#0.NONE.[0], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#49:Subset#0.NONE.[], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#50:Subset#0.ENUMERABLE.[0], best=rel#55, importance=0.5
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}

Importances: { rel#36:Subset#0.ENUMERABLE.[]=1.0
rel#47:Subset#0.NONE.[0]=0.495 rel#50:Subset#0.ENUMERABLE.[0]=0.495}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [ProjectMergeRule:force_mode] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [ProjectScanRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
importance 0.5
rule [ProjectRemoveRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
[EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#745: Apply
rule [EnumerableLimitRule] to
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#745
generated 0 successors.
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 26/24;
PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#36:Subset#0.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=1.0
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}
    rel#47:Subset#0.NONE.[0], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#49:Subset#0.NONE.[], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#50:Subset#0.ENUMERABLE.[0], best=rel#55, importance=0.5
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}

Importances: { rel#36:Subset#0.ENUMERABLE.[]=1.0
rel#47:Subset#0.NONE.[0]=0.495 rel#50:Subset#0.ENUMERABLE.[0]=0.495}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [ProjectScanRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
importance 0.5
rule [ProjectRemoveRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
[ProjectMergeRule:force_mode] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#809: Apply
rule [ProjectMergeRule:force_mode] to
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#809
generated 0 successors.
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 27/25;
PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#36:Subset#0.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=1.0
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}
    rel#47:Subset#0.NONE.[0], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#49:Subset#0.NONE.[], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#50:Subset#0.ENUMERABLE.[0], best=rel#55, importance=0.5
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}

Importances: { rel#36:Subset#0.ENUMERABLE.[]=1.0
rel#47:Subset#0.NONE.[0]=0.495 rel#50:Subset#0.ENUMERABLE.[0]=0.495}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [ProjectScanRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
importance 0.5
rule [ProjectRemoveRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
[PruneSortLimit0] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#440: Apply
rule [PruneSortLimit0] to
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#440
generated 0 successors.
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 28/26;
PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#36:Subset#0.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=1.0
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}
    rel#47:Subset#0.NONE.[0], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#49:Subset#0.NONE.[], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#50:Subset#0.ENUMERABLE.[0], best=rel#55, importance=0.5
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}

Importances: { rel#36:Subset#0.ENUMERABLE.[]=1.0
rel#47:Subset#0.NONE.[0]=0.495 rel#50:Subset#0.ENUMERABLE.[0]=0.495}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [ProjectRemoveRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
[ProjectScanRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#401: Apply
rule [ProjectScanRule] to
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#401
generated 0 successors.
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 29/27;
PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#36:Subset#0.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=1.0
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}
    rel#47:Subset#0.NONE.[0], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#49:Subset#0.NONE.[], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#50:Subset#0.ENUMERABLE.[0], best=rel#55, importance=0.5
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}

Importances: { rel#36:Subset#0.ENUMERABLE.[]=1.0
rel#47:Subset#0.NONE.[0]=0.495 rel#50:Subset#0.ENUMERABLE.[0]=0.495}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
rule [EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
[ProjectRemoveRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#399: Apply
rule [ProjectRemoveRule] to
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
rel#36 via ProjectRemoveRule
[main] TRACE org.apache.calcite.plan.RelOptPlanner - call#399: Rule
ProjectRemoveRule arguments
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
created rel#36:RelSubset
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#399
generated 1 successors: [rel#36:Subset#0.ENUMERABLE.[]]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 30/28;
PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#36:Subset#0.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=1.0
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}
    rel#47:Subset#0.NONE.[0], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#49:Subset#0.NONE.[], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#50:Subset#0.ENUMERABLE.[0], best=rel#55, importance=0.5
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}

Importances: { rel#36:Subset#0.ENUMERABLE.[]=1.0
rel#47:Subset#0.NONE.[0]=0.495 rel#50:Subset#0.ENUMERABLE.[0]=0.495}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
[EnumerableSortRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#442: Apply
rule [EnumerableSortRule] to
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - new EnumerableSort#57
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
rel#57 via EnumerableSortRule
[main] TRACE org.apache.calcite.plan.RelOptPlanner - call#442: Rule
EnumerableSortRule arguments
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
created rel#57:EnumerableSort
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Register: rel#57
is equivalent to
rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#442
generated 1 successors:
[rel#57:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 31/29;
PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#36:Subset#0.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=1.0
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}
    rel#47:Subset#0.NONE.[0], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#49:Subset#0.NONE.[], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#50:Subset#0.ENUMERABLE.[0], best=rel#55, importance=0.5
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}

Importances: { rel#36:Subset#0.ENUMERABLE.[]=1.0
rel#47:Subset#0.NONE.[0]=0.495 rel#50:Subset#0.ENUMERABLE.[0]=0.495}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
[EnumerableProjectRule] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#397: Apply
rule [EnumerableProjectRule] to
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - new EnumerableProject#58
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
rel#58 via EnumerableProjectRule
[main] TRACE org.apache.calcite.plan.RelOptPlanner - call#397: Rule
EnumerableProjectRule arguments
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
created rel#58:EnumerableProject
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Register
rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)
in rel#36:Subset#0.ENUMERABLE.[]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
[rel#36:Subset#0.ENUMERABLE.[]] is 1.0
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Importance of
[rel#36:Subset#0.ENUMERABLE.[]] is 1.0
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [ProjectMergeRule:force_mode] rels
[rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [ProjectMergeRule:force_mode] rels
[rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [ProjectMergeRule:force_mode] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [ProjectRemoveRule] rels
[rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - OPTIMIZE
Rule-match queued: rule [ProjectScanRule] rels
[rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#397
generated 1 successors:
[rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 32/30;
PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#36:Subset#0.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=1.0
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}
        rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={2.0 rows, 5.0 cpu, 0.0 io}
    rel#47:Subset#0.NONE.[0], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#49:Subset#0.NONE.[], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#50:Subset#0.ENUMERABLE.[0], best=rel#55, importance=0.5
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}

Importances: { rel#36:Subset#0.ENUMERABLE.[]=1.0
rel#47:Subset#0.NONE.[0]=0.495 rel#50:Subset#0.ENUMERABLE.[0]=0.495}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [ProjectRemoveRule] rels
[rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 1.0
rule [ProjectMergeRule:force_mode] rels
[rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 1.0
rule [ProjectMergeRule:force_mode] rels
[rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 1.0
rule [ProjectMergeRule:force_mode] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Skip match: rule
[ProjectScanRule] rels
[rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [ProjectMergeRule:force_mode] rels
[rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 1.0
rule [ProjectMergeRule:force_mode] rels
[rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 1.0
rule [ProjectMergeRule:force_mode] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
[ProjectRemoveRule] rels
[rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#881: Apply
rule [ProjectRemoveRule] to
[rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Transform to:
rel#36 via ProjectRemoveRule
[main] TRACE org.apache.calcite.plan.RelOptPlanner - call#881: Rule
ProjectRemoveRule arguments
[rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
created rel#36:RelSubset
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#881
generated 1 successors: [rel#36:Subset#0.ENUMERABLE.[]]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 33/31;
PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#36:Subset#0.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=1.0
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}
        rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={2.0 rows, 5.0 cpu, 0.0 io}
    rel#47:Subset#0.NONE.[0], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#49:Subset#0.NONE.[], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#50:Subset#0.ENUMERABLE.[0], best=rel#55, importance=0.5
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}

Importances: { rel#36:Subset#0.ENUMERABLE.[]=1.0
rel#47:Subset#0.NONE.[0]=0.495 rel#50:Subset#0.ENUMERABLE.[0]=0.495}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [ProjectMergeRule:force_mode] rels
[rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
importance 1.0
rule [ProjectMergeRule:force_mode] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Skip match: rule
[ProjectMergeRule:force_mode] rels
[rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [ProjectMergeRule:force_mode] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
importance 0.5
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
[ProjectMergeRule:force_mode] rels
[rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#865: Apply
rule [ProjectMergeRule:force_mode] to
[rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#865
generated 0 successors.
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 34/32;
PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#36:Subset#0.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=1.0
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}
        rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={2.0 rows, 5.0 cpu, 0.0 io}
    rel#47:Subset#0.NONE.[0], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#49:Subset#0.NONE.[], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#50:Subset#0.ENUMERABLE.[0], best=rel#55, importance=0.5
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}

Importances: { rel#36:Subset#0.ENUMERABLE.[]=1.0
rel#47:Subset#0.NONE.[0]=0.495 rel#50:Subset#0.ENUMERABLE.[0]=0.495}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
rule [EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#38:Subset#1.NONE.[],sort0=$0,dir0=ASC)]
importance 0.5
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
[ProjectMergeRule:force_mode] rels
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#868: Apply
rule [ProjectMergeRule:force_mode] to
[rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#868
generated 0 successors.
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 35/33;
PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#36:Subset#0.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=1.0
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}
        rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={2.0 rows, 5.0 cpu, 0.0 io}
    rel#47:Subset#0.NONE.[0], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#49:Subset#0.NONE.[], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#50:Subset#0.ENUMERABLE.[0], best=rel#55, importance=0.5
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}

Importances: { rel#36:Subset#0.ENUMERABLE.[]=1.0
rel#47:Subset#0.NONE.[0]=0.495 rel#50:Subset#0.ENUMERABLE.[0]=0.495}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Sorted rule queue:
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Pop match: rule
[EnumerableLimitRule] rels
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#454: Apply
rule [EnumerableLimitRule] to
[rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC)]
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - call#454
generated 0 successors.
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 36/34;
PHASE = OPTIMIZE; COST = {1.0 rows, 2.0 cpu, 0.0 io}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#36:Subset#0.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=1.0
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}
        rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={2.0 rows, 5.0 cpu, 0.0 io}
    rel#47:Subset#0.NONE.[0], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#49:Subset#0.NONE.[], best=null, importance=0.5
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#50:Subset#0.ENUMERABLE.[0], best=rel#55, importance=0.5
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}

Importances: { rel#36:Subset#0.ENUMERABLE.[]=1.0
rel#47:Subset#0.NONE.[0]=0.495 rel#50:Subset#0.ENUMERABLE.[0]=0.495}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - boostImportance(1.0, [])
[main] DEBUG org.apache.calcite.plan.RelOptPlanner - PLANNER =
org.apache.calcite.plan.volcano.VolcanoPlanner@61e3a1fd; TICK = 37/1;
PHASE = CLEANUP; COST = {1.0 rows, 2.0 cpu, 0.0 io}
[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#36:Subset#0.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=1.0
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}
        rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={2.0 rows, 5.0 cpu, 0.0 io}
    rel#47:Subset#0.NONE.[0], best=null, importance=0.81
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#49:Subset#0.NONE.[], best=null, importance=0.9
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#50:Subset#0.ENUMERABLE.[0], best=rel#55, importance=0.9
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}

Importances: { rel#36:Subset#0.ENUMERABLE.[]=1.0
rel#49:Subset#0.NONE.[]=0.9 rel#50:Subset#0.ENUMERABLE.[0]=0.9
rel#47:Subset#0.NONE.[0]=0.81}

[main] TRACE org.apache.calcite.plan.RelOptPlanner - Root:
rel#36:Subset#0.ENUMERABLE.[]
Original rel:
LogicalSort(subset=[rel#41:Subset#2.ENUMERABLE.[]], sort0=[$0],
dir0=[ASC]): rowcount = 1.0, cumulative cost = {1.0 rows, 12.0 cpu,
0.0 io}, id = 39
  LogicalProject(subset=[rel#38:Subset#1.NONE.[]], k1=[$0], n1=[$1],
s1=[$2]): rowcount = 1.0, cumulative cost = {1.0 rows, 3.0 cpu, 0.0
io}, id = 37
    EnumerableTableScan(subset=[rel#36:Subset#0.ENUMERABLE.[]],
table=[[tblspace1, tsql]]): rowcount = 1.0, cumulative cost = {1.0
rows, 2.0 cpu, 0.0 io}, id = 33

Sets:
Set#0, type: RecordType(VARCHAR k1, INTEGER n1, VARCHAR s1)
    rel#36:Subset#0.ENUMERABLE.[], best=rel#33, importance=1.0
        rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1,
tsql]), rowcount=1.0, cumulative cost={1.0 rows, 2.0 cpu, 0.0 io}
        rel#44:AbstractConverter.ENUMERABLE.[](input=rel#49:Subset#0.NONE.[],convention=ENUMERABLE,sort=[]),
rowcount=1.0, cumulative cost={inf}
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}
        rel#58:EnumerableProject.ENUMERABLE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={2.0 rows, 5.0 cpu, 0.0 io}
    rel#47:Subset#0.NONE.[0], best=null, importance=0.81
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#49:Subset#0.NONE.[], best=null, importance=0.9
        rel#45:LogicalSort.NONE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#37:LogicalProject.NONE.[](input=rel#36:Subset#0.ENUMERABLE.[],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
        rel#39:LogicalSort.NONE.[0](input=rel#49:Subset#0.NONE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={inf}
        rel#48:LogicalProject.NONE.[0](input=rel#47:Subset#0.NONE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={inf}
    rel#50:Subset#0.ENUMERABLE.[0], best=rel#55, importance=0.9
        rel#51:EnumerableProject.ENUMERABLE.[[0]](input=rel#50:Subset#0.ENUMERABLE.[0],k1=$0,n1=$1,s1=$2),
rowcount=1.0, cumulative cost={3.0 rows, 17.0 cpu, 0.0 io}
        rel#55:EnumerableSort.ENUMERABLE.[0](input=rel#36:Subset#0.ENUMERABLE.[],sort0=$0,dir0=ASC),
rowcount=1.0, cumulative cost={2.0 rows, 14.0 cpu, 0.0 io}


[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Cheapest plan:
EnumerableTableScan(table=[[tblspace1, tsql]]): rowcount = 1.0,
cumulative cost = {1.0 rows, 2.0 cpu, 0.0 io}, id = 33

[main] DEBUG org.apache.calcite.plan.RelOptPlanner - Provenance:
rel#33:EnumerableTableScan.ENUMERABLE.[](table=[tblspace1, tsql])
  no parent

Query: select * from tblspace1.tsql order by k1
-- Best  Plan
EnumerableTableScan(table=[[tblspace1, tsql]]): rowcount = 1.0,
cumulative cost = {1.0 rows, 2.0 cpu, 0.0 io}, id = 33
Il giorno mar 25 set 2018 alle ore 17:19 Stamatis Zampetakis
<za...@gmail.com> ha scritto:
>
> A disappearing Sort operator makes me think of SortRemoveRule.
> I am not sure if you are using this rule but it might worth setting a
> breakpoint at the onMatch method.
>
> Since your problem seems related with the RelCollationTraitDef you may also
> want to look in
> RelCollationTraitDef#convert method.
>
>
> Στις Δευ, 24 Σεπ 2018 στις 11:05 μ.μ., ο/η Enrico Olivelli <
> eolivelli@gmail.com> έγραψε:
>
> > Il lun 24 set 2018, 13:50 Enrico Olivelli <eo...@gmail.com> ha
> > scritto:
> >
> > >
> > >
> > > Il dom 23 set 2018, 22:22 Vladimir Sitnikov <sitnikov.vladimir@gmail.com
> > >
> > > ha scritto:
> > >
> > >> Enrico,
> > >>
> > >> 1) EnumerableMergeJoinRule does not seem to work (see
> > >> https://issues.apache.org/jira/browse/CALCITE-2592 ).
> > >> It seems to be broken since Calcite 1.9.0
> > >>
> > >> 2) It turns out you need to add RelTraitDefs explicitly to the planner,
> > >> otherwise it just ignores the traits (or something like that).
> > >>
> > >> Would you please try
> > >> adding org.apache.calcite.rel.RelCollationTraitDef#INSTANCE to the list
> > of
> > >> traits you use for planning? (see
> > >>
> > >>
> > https://github.com/diennea/herddb/blob/0c7c01584350d57d8102511b987e5f880f3f65bd/herddb-core/src/main/java/herddb/sql/CalcitePlanner.java#L412
> > >>  )
> > >>
> > >> It works!
> > >>
> > >
> > > Now the planner does not choose a merge join as expected. And I guess it
> > > will never do so due the bug you have mentioned
> > >
> >
> > Too early.
> > Now the planner is stripping every EnumerableSort from the plan, leading to
> > wrong results at every query with 'order by'
> > I am debugging...
> > Maybe any bell rings...
> >
> >
> > Enrico
> >
> >
> >
> >
> > > Thank you very much
> > >
> > > Enrico
> > >
> > >
> > >>
> > >> PS. You are using a somewhat creative way of planning the whole thing as
> > >> Enumerable then converting the plan relations to your own format.
> > >>
> > >
> > > Uh
> > > Othewise I should have created my own Convention, but as far I understand
> > > it is not really needed, in the future maybe we refactor the whole
> > > integration with Calcite
> > >
> > > Enrico
> > >
> > >
> > >> Vladimir
> > >
> > >
> > >> --
> > >
> > >
> > > -- Enrico Olivelli
> > >
> > --
> >
> >
> > -- Enrico Olivelli
> >

Re: Help with EnumerableMergeJoinRule which is losing a RelCollection trait

Posted by Stamatis Zampetakis <za...@gmail.com>.
A disappearing Sort operator makes me think of SortRemoveRule.
I am not sure if you are using this rule but it might worth setting a
breakpoint at the onMatch method.

Since your problem seems related with the RelCollationTraitDef you may also
want to look in
RelCollationTraitDef#convert method.


Στις Δευ, 24 Σεπ 2018 στις 11:05 μ.μ., ο/η Enrico Olivelli <
eolivelli@gmail.com> έγραψε:

> Il lun 24 set 2018, 13:50 Enrico Olivelli <eo...@gmail.com> ha
> scritto:
>
> >
> >
> > Il dom 23 set 2018, 22:22 Vladimir Sitnikov <sitnikov.vladimir@gmail.com
> >
> > ha scritto:
> >
> >> Enrico,
> >>
> >> 1) EnumerableMergeJoinRule does not seem to work (see
> >> https://issues.apache.org/jira/browse/CALCITE-2592 ).
> >> It seems to be broken since Calcite 1.9.0
> >>
> >> 2) It turns out you need to add RelTraitDefs explicitly to the planner,
> >> otherwise it just ignores the traits (or something like that).
> >>
> >> Would you please try
> >> adding org.apache.calcite.rel.RelCollationTraitDef#INSTANCE to the list
> of
> >> traits you use for planning? (see
> >>
> >>
> https://github.com/diennea/herddb/blob/0c7c01584350d57d8102511b987e5f880f3f65bd/herddb-core/src/main/java/herddb/sql/CalcitePlanner.java#L412
> >>  )
> >>
> >> It works!
> >>
> >
> > Now the planner does not choose a merge join as expected. And I guess it
> > will never do so due the bug you have mentioned
> >
>
> Too early.
> Now the planner is stripping every EnumerableSort from the plan, leading to
> wrong results at every query with 'order by'
> I am debugging...
> Maybe any bell rings...
>
>
> Enrico
>
>
>
>
> > Thank you very much
> >
> > Enrico
> >
> >
> >>
> >> PS. You are using a somewhat creative way of planning the whole thing as
> >> Enumerable then converting the plan relations to your own format.
> >>
> >
> > Uh
> > Othewise I should have created my own Convention, but as far I understand
> > it is not really needed, in the future maybe we refactor the whole
> > integration with Calcite
> >
> > Enrico
> >
> >
> >> Vladimir
> >
> >
> >> --
> >
> >
> > -- Enrico Olivelli
> >
> --
>
>
> -- Enrico Olivelli
>

Re: Help with EnumerableMergeJoinRule which is losing a RelCollection trait

Posted by Enrico Olivelli <eo...@gmail.com>.
Il lun 24 set 2018, 13:50 Enrico Olivelli <eo...@gmail.com> ha scritto:

>
>
> Il dom 23 set 2018, 22:22 Vladimir Sitnikov <si...@gmail.com>
> ha scritto:
>
>> Enrico,
>>
>> 1) EnumerableMergeJoinRule does not seem to work (see
>> https://issues.apache.org/jira/browse/CALCITE-2592 ).
>> It seems to be broken since Calcite 1.9.0
>>
>> 2) It turns out you need to add RelTraitDefs explicitly to the planner,
>> otherwise it just ignores the traits (or something like that).
>>
>> Would you please try
>> adding org.apache.calcite.rel.RelCollationTraitDef#INSTANCE to the list of
>> traits you use for planning? (see
>>
>> https://github.com/diennea/herddb/blob/0c7c01584350d57d8102511b987e5f880f3f65bd/herddb-core/src/main/java/herddb/sql/CalcitePlanner.java#L412
>>  )
>>
>> It works!
>>
>
> Now the planner does not choose a merge join as expected. And I guess it
> will never do so due the bug you have mentioned
>

Too early.
Now the planner is stripping every EnumerableSort from the plan, leading to
wrong results at every query with 'order by'
I am debugging...
Maybe any bell rings...


Enrico




> Thank you very much
>
> Enrico
>
>
>>
>> PS. You are using a somewhat creative way of planning the whole thing as
>> Enumerable then converting the plan relations to your own format.
>>
>
> Uh
> Othewise I should have created my own Convention, but as far I understand
> it is not really needed, in the future maybe we refactor the whole
> integration with Calcite
>
> Enrico
>
>
>> Vladimir
>
>
>> --
>
>
> -- Enrico Olivelli
>
-- 


-- Enrico Olivelli

Re: Help with EnumerableMergeJoinRule which is losing a RelCollection trait

Posted by Enrico Olivelli <eo...@gmail.com>.
Il dom 23 set 2018, 22:22 Vladimir Sitnikov <si...@gmail.com>
ha scritto:

> Enrico,
>
> 1) EnumerableMergeJoinRule does not seem to work (see
> https://issues.apache.org/jira/browse/CALCITE-2592 ).
> It seems to be broken since Calcite 1.9.0
>
> 2) It turns out you need to add RelTraitDefs explicitly to the planner,
> otherwise it just ignores the traits (or something like that).
>
> Would you please try
> adding org.apache.calcite.rel.RelCollationTraitDef#INSTANCE to the list of
> traits you use for planning? (see
>
> https://github.com/diennea/herddb/blob/0c7c01584350d57d8102511b987e5f880f3f65bd/herddb-core/src/main/java/herddb/sql/CalcitePlanner.java#L412
>  )
>
> It works!
>

Now the planner does not choose a merge join as expected. And I guess it
will never do so due the bug you have mentioned

Thank you very much

Enrico


>
> PS. You are using a somewhat creative way of planning the whole thing as
> Enumerable then converting the plan relations to your own format.
>

Uh
Othewise I should have created my own Convention, but as far I understand
it is not really needed, in the future maybe we refactor the whole
integration with Calcite

Enrico


> Vladimir
>
-- 


-- Enrico Olivelli

Re: Help with EnumerableMergeJoinRule which is losing a RelCollection trait

Posted by Vladimir Sitnikov <si...@gmail.com>.
Enrico,

1) EnumerableMergeJoinRule does not seem to work (see
https://issues.apache.org/jira/browse/CALCITE-2592 ).
It seems to be broken since Calcite 1.9.0

2) It turns out you need to add RelTraitDefs explicitly to the planner,
otherwise it just ignores the traits (or something like that).

Would you please try
adding org.apache.calcite.rel.RelCollationTraitDef#INSTANCE to the list of
traits you use for planning? (see
https://github.com/diennea/herddb/blob/0c7c01584350d57d8102511b987e5f880f3f65bd/herddb-core/src/main/java/herddb/sql/CalcitePlanner.java#L412
 )

PS. You are using a somewhat creative way of planning the whole thing as
Enumerable then converting the plan relations to your own format.

Vladimir

Re: Help with EnumerableMergeJoinRule which is losing a RelCollection trait

Posted by Enrico Olivelli <eo...@gmail.com>.
Il dom 23 set 2018, 16:40 Stamatis Zampetakis <za...@gmail.com> ha
scritto:

> Hi again,
>
> thanks for the clarifications!
>
> RelTraitSet#replace is meant to replace some traits *IF* there are some
> already present.
>

Dont you think that this is not feasible in the current context the rule
should not fire?
Actually this is leading to bad results silently


If your planner does not have the RelCollationTraitDef activated replace
> will have no effect since there are not going to be any traits of this
> definition present.
> In other words, I think your planner is missing the RelCollationTraitDef.
>

I will try. Thank you

Enrico

>
> Best,
> Stamatis
>
> Στις Κυρ, 23 Σεπ 2018 στις 8:24 π.μ., ο/η Enrico Olivelli <
> eolivelli@gmail.com> έγραψε:
>
> > Il giorno dom 23 set 2018 alle ore 00:11 Stamatis Zampetakis
> > <za...@gmail.com> ha scritto:
> > >
> > > Hi Enrico,
> > >
> > > I think a bit more context would help.
> > >
> > > What kind of org.apache.calcite.schema.Table are you using in your
> > Schema?
> >
> > Hi Stamatis,
> >
> > This is my implementation
> >
> >
> https://github.com/diennea/herddb/blob/0c7c01584350d57d8102511b987e5f880f3f65bd/herddb-core/src/main/java/herddb/sql/CalcitePlanner.java#L1237
> >
> > essentially
> > @Override
> > public Statistic getStatistic() {
> >    return Statistics.of(tableManager.getStats().getTablesize(),  keys);
> > }
> >
> > where "keys" is the Primary Key.
> >
> > So I assume that this means that there is no intrinsic "collation" for
> the
> > table
> > in my undestanding these collations in Statistic define a natural
> > order in the table, like in a table clustered by a index
> > and the system may assume that an EnumerableTableScan is naturally
> > sorted by that collation.
> >
> > Bonus question:
> > can you give me some more explanation about the meaning of
> > "RelTraitSet#replace" ?
> > should it 'add' collations to the Rel or it is a conversion and so, it
> > if fails the EnumerableMergeJoinRule should not fire ?
> >
> >
> > Thank you very much
> > Enrico
> >
> >
> >
> > > I suppose you already looked but just in case are there any kind of
> > > statistics on these tables.
> > > I've seen a similar case where the statistics of the table were
> declaring
> > > that some columns were sorted without this being true.
> > > I just want to make sure that this is not the case here.
> > >
> > > Best,
> > > Stamatis
> > >
> > >
> > > Στις Σάβ, 22 Σεπ 2018 στις 11:43 π.μ., ο/η Enrico Olivelli <
> > > eolivelli@gmail.com> έγραψε:
> > >
> > > > Hi,
> > > > We found a strange behaviour in an execution plan, basially we have
> an
> > > > EnumerableMergeJoin which has as input two non-sorted
> > > > EnumerableTableScan
> > > >
> > > > all the details are in this issue on HerdDB
> > > >
> > > > https://github.com/diennea/herddb/issues/262#issuecomment-423590573
> > > >
> > > > Cut and paste from the issue in the bottom of this email
> > > >
> > > > Any help is very appreciated, maybe some ring bells ....
> > > >
> > > > [ISSUE]
> > > >
> > > > query:
> > > > SELECT * FROM license t0, customer c WHERE c.customer_id =
> > t0.customer_id
> > > >
> > > > It seems that Calcite is planning a Merge Join, but the tables are
> not
> > > > sorted according to the merge keys.
> > > >
> > > > "License" table:
> > > > TABLE PK (non clustered): [license_id]
> > > > COL: license_id serialPos: 0 (serialPos is the index of the colum for
> > > > Calcite)
> > > > COL: application serialPos: 1
> > > > COL: creation serialPos: 2
> > > > COL: data serialPos: 3
> > > > COL: deleted serialPos: 4
> > > > COL: modification serialPos: 5
> > > > COL: signature serialPos: 6
> > > > COL: customer_id serialPos: 7
> > > >
> > > > "Customer" table:
> > > > TABLE PK (non clustered): [customer_id]
> > > > COL: customer_id serialPos: 0
> > > > COL: contact_email serialPos: 1
> > > > COL: contact_person serialPos: 2
> > > > COL: creation serialPos: 3
> > > > COL: deleted serialPos: 4
> > > > COL: modification serialPos: 5
> > > > COL: name serialPos: 6
> > > > COL: vetting serialPos: 7
> > > >
> > > > the join is on PK (non clustered) column of table customer,
> > > > and the "customer_id" column of table 'license' which is not sorted
> > > > naturally by 'customerid' (we do not have clustered indexes !!)
> > > >
> > > > This is the plan:
> > > >
> > > > EnumerableMergeJoin(condition=[=($7, $9)], joinType=[inner]):
> rowcount
> > > > = 15.75, cumulative cost = {59.75 rows, 24.0 cpu, 0.0 io}, id = 114
> > > > EnumerableTableScan(table=[[herd, license]]): rowcount = 15.0,
> > > > cumulative cost = {15.0 rows, 16.0 cpu, 0.0 io}, id = 28
> > > > EnumerableTableScan(table=[[herd, customer]]): rowcount = 7.0,
> > > > cumulative cost = {7.0 rows, 8.0 cpu, 0.0 io}, id = 29
> > > >
> > > > EnumerableTableScan does not contain any information which tells that
> > > > the Scan MUST be sorted according to the join keys (field 7 in
> > > > "licence", and field 0 in "customer")
> > > >
> > > > Here in Calcite code the additional 'Collation' is lost as the
> > > > "replace" does not contain any 'RelCollation', so the inputs of the
> > > > join are not transformed
> > > >
> > > >
> > > >
> >
> https://github.com/apache/calcite/blob/2ab83e468d282a9428e533853aea5253816889fb/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableMergeJoinRule.java#L78
> > > >
> > > > is it a bug in Calcite or in how we are passing data to Calcite ?
> > > > Tables do not have any impliticit "collation" in HerdDB so we are not
> > > > passing any 'RelCollation'
> > > >
> > > >
> > > > Thank you
> > > >
> > > > Enrico
> > > >
> >
>
-- 


-- Enrico Olivelli

Re: Help with EnumerableMergeJoinRule which is losing a RelCollection trait

Posted by Stamatis Zampetakis <za...@gmail.com>.
Hi again,

thanks for the clarifications!

RelTraitSet#replace is meant to replace some traits *IF* there are some
already present.
If your planner does not have the RelCollationTraitDef activated replace
will have no effect since there are not going to be any traits of this
definition present.
In other words, I think your planner is missing the RelCollationTraitDef.

Best,
Stamatis

Στις Κυρ, 23 Σεπ 2018 στις 8:24 π.μ., ο/η Enrico Olivelli <
eolivelli@gmail.com> έγραψε:

> Il giorno dom 23 set 2018 alle ore 00:11 Stamatis Zampetakis
> <za...@gmail.com> ha scritto:
> >
> > Hi Enrico,
> >
> > I think a bit more context would help.
> >
> > What kind of org.apache.calcite.schema.Table are you using in your
> Schema?
>
> Hi Stamatis,
>
> This is my implementation
>
> https://github.com/diennea/herddb/blob/0c7c01584350d57d8102511b987e5f880f3f65bd/herddb-core/src/main/java/herddb/sql/CalcitePlanner.java#L1237
>
> essentially
> @Override
> public Statistic getStatistic() {
>    return Statistics.of(tableManager.getStats().getTablesize(),  keys);
> }
>
> where "keys" is the Primary Key.
>
> So I assume that this means that there is no intrinsic "collation" for the
> table
> in my undestanding these collations in Statistic define a natural
> order in the table, like in a table clustered by a index
> and the system may assume that an EnumerableTableScan is naturally
> sorted by that collation.
>
> Bonus question:
> can you give me some more explanation about the meaning of
> "RelTraitSet#replace" ?
> should it 'add' collations to the Rel or it is a conversion and so, it
> if fails the EnumerableMergeJoinRule should not fire ?
>
>
> Thank you very much
> Enrico
>
>
>
> > I suppose you already looked but just in case are there any kind of
> > statistics on these tables.
> > I've seen a similar case where the statistics of the table were declaring
> > that some columns were sorted without this being true.
> > I just want to make sure that this is not the case here.
> >
> > Best,
> > Stamatis
> >
> >
> > Στις Σάβ, 22 Σεπ 2018 στις 11:43 π.μ., ο/η Enrico Olivelli <
> > eolivelli@gmail.com> έγραψε:
> >
> > > Hi,
> > > We found a strange behaviour in an execution plan, basially we have an
> > > EnumerableMergeJoin which has as input two non-sorted
> > > EnumerableTableScan
> > >
> > > all the details are in this issue on HerdDB
> > >
> > > https://github.com/diennea/herddb/issues/262#issuecomment-423590573
> > >
> > > Cut and paste from the issue in the bottom of this email
> > >
> > > Any help is very appreciated, maybe some ring bells ....
> > >
> > > [ISSUE]
> > >
> > > query:
> > > SELECT * FROM license t0, customer c WHERE c.customer_id =
> t0.customer_id
> > >
> > > It seems that Calcite is planning a Merge Join, but the tables are not
> > > sorted according to the merge keys.
> > >
> > > "License" table:
> > > TABLE PK (non clustered): [license_id]
> > > COL: license_id serialPos: 0 (serialPos is the index of the colum for
> > > Calcite)
> > > COL: application serialPos: 1
> > > COL: creation serialPos: 2
> > > COL: data serialPos: 3
> > > COL: deleted serialPos: 4
> > > COL: modification serialPos: 5
> > > COL: signature serialPos: 6
> > > COL: customer_id serialPos: 7
> > >
> > > "Customer" table:
> > > TABLE PK (non clustered): [customer_id]
> > > COL: customer_id serialPos: 0
> > > COL: contact_email serialPos: 1
> > > COL: contact_person serialPos: 2
> > > COL: creation serialPos: 3
> > > COL: deleted serialPos: 4
> > > COL: modification serialPos: 5
> > > COL: name serialPos: 6
> > > COL: vetting serialPos: 7
> > >
> > > the join is on PK (non clustered) column of table customer,
> > > and the "customer_id" column of table 'license' which is not sorted
> > > naturally by 'customerid' (we do not have clustered indexes !!)
> > >
> > > This is the plan:
> > >
> > > EnumerableMergeJoin(condition=[=($7, $9)], joinType=[inner]): rowcount
> > > = 15.75, cumulative cost = {59.75 rows, 24.0 cpu, 0.0 io}, id = 114
> > > EnumerableTableScan(table=[[herd, license]]): rowcount = 15.0,
> > > cumulative cost = {15.0 rows, 16.0 cpu, 0.0 io}, id = 28
> > > EnumerableTableScan(table=[[herd, customer]]): rowcount = 7.0,
> > > cumulative cost = {7.0 rows, 8.0 cpu, 0.0 io}, id = 29
> > >
> > > EnumerableTableScan does not contain any information which tells that
> > > the Scan MUST be sorted according to the join keys (field 7 in
> > > "licence", and field 0 in "customer")
> > >
> > > Here in Calcite code the additional 'Collation' is lost as the
> > > "replace" does not contain any 'RelCollation', so the inputs of the
> > > join are not transformed
> > >
> > >
> > >
> https://github.com/apache/calcite/blob/2ab83e468d282a9428e533853aea5253816889fb/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableMergeJoinRule.java#L78
> > >
> > > is it a bug in Calcite or in how we are passing data to Calcite ?
> > > Tables do not have any impliticit "collation" in HerdDB so we are not
> > > passing any 'RelCollation'
> > >
> > >
> > > Thank you
> > >
> > > Enrico
> > >
>

Re: Help with EnumerableMergeJoinRule which is losing a RelCollection trait

Posted by Enrico Olivelli <eo...@gmail.com>.
Il giorno dom 23 set 2018 alle ore 00:11 Stamatis Zampetakis
<za...@gmail.com> ha scritto:
>
> Hi Enrico,
>
> I think a bit more context would help.
>
> What kind of org.apache.calcite.schema.Table are you using in your Schema?

Hi Stamatis,

This is my implementation
https://github.com/diennea/herddb/blob/0c7c01584350d57d8102511b987e5f880f3f65bd/herddb-core/src/main/java/herddb/sql/CalcitePlanner.java#L1237

essentially
@Override
public Statistic getStatistic() {
   return Statistics.of(tableManager.getStats().getTablesize(),  keys);
}

where "keys" is the Primary Key.

So I assume that this means that there is no intrinsic "collation" for the table
in my undestanding these collations in Statistic define a natural
order in the table, like in a table clustered by a index
and the system may assume that an EnumerableTableScan is naturally
sorted by that collation.

Bonus question:
can you give me some more explanation about the meaning of
"RelTraitSet#replace" ?
should it 'add' collations to the Rel or it is a conversion and so, it
if fails the EnumerableMergeJoinRule should not fire ?


Thank you very much
Enrico



> I suppose you already looked but just in case are there any kind of
> statistics on these tables.
> I've seen a similar case where the statistics of the table were declaring
> that some columns were sorted without this being true.
> I just want to make sure that this is not the case here.
>
> Best,
> Stamatis
>
>
> Στις Σάβ, 22 Σεπ 2018 στις 11:43 π.μ., ο/η Enrico Olivelli <
> eolivelli@gmail.com> έγραψε:
>
> > Hi,
> > We found a strange behaviour in an execution plan, basially we have an
> > EnumerableMergeJoin which has as input two non-sorted
> > EnumerableTableScan
> >
> > all the details are in this issue on HerdDB
> >
> > https://github.com/diennea/herddb/issues/262#issuecomment-423590573
> >
> > Cut and paste from the issue in the bottom of this email
> >
> > Any help is very appreciated, maybe some ring bells ....
> >
> > [ISSUE]
> >
> > query:
> > SELECT * FROM license t0, customer c WHERE c.customer_id = t0.customer_id
> >
> > It seems that Calcite is planning a Merge Join, but the tables are not
> > sorted according to the merge keys.
> >
> > "License" table:
> > TABLE PK (non clustered): [license_id]
> > COL: license_id serialPos: 0 (serialPos is the index of the colum for
> > Calcite)
> > COL: application serialPos: 1
> > COL: creation serialPos: 2
> > COL: data serialPos: 3
> > COL: deleted serialPos: 4
> > COL: modification serialPos: 5
> > COL: signature serialPos: 6
> > COL: customer_id serialPos: 7
> >
> > "Customer" table:
> > TABLE PK (non clustered): [customer_id]
> > COL: customer_id serialPos: 0
> > COL: contact_email serialPos: 1
> > COL: contact_person serialPos: 2
> > COL: creation serialPos: 3
> > COL: deleted serialPos: 4
> > COL: modification serialPos: 5
> > COL: name serialPos: 6
> > COL: vetting serialPos: 7
> >
> > the join is on PK (non clustered) column of table customer,
> > and the "customer_id" column of table 'license' which is not sorted
> > naturally by 'customerid' (we do not have clustered indexes !!)
> >
> > This is the plan:
> >
> > EnumerableMergeJoin(condition=[=($7, $9)], joinType=[inner]): rowcount
> > = 15.75, cumulative cost = {59.75 rows, 24.0 cpu, 0.0 io}, id = 114
> > EnumerableTableScan(table=[[herd, license]]): rowcount = 15.0,
> > cumulative cost = {15.0 rows, 16.0 cpu, 0.0 io}, id = 28
> > EnumerableTableScan(table=[[herd, customer]]): rowcount = 7.0,
> > cumulative cost = {7.0 rows, 8.0 cpu, 0.0 io}, id = 29
> >
> > EnumerableTableScan does not contain any information which tells that
> > the Scan MUST be sorted according to the join keys (field 7 in
> > "licence", and field 0 in "customer")
> >
> > Here in Calcite code the additional 'Collation' is lost as the
> > "replace" does not contain any 'RelCollation', so the inputs of the
> > join are not transformed
> >
> >
> > https://github.com/apache/calcite/blob/2ab83e468d282a9428e533853aea5253816889fb/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableMergeJoinRule.java#L78
> >
> > is it a bug in Calcite or in how we are passing data to Calcite ?
> > Tables do not have any impliticit "collation" in HerdDB so we are not
> > passing any 'RelCollation'
> >
> >
> > Thank you
> >
> > Enrico
> >

Re: Help with EnumerableMergeJoinRule which is losing a RelCollection trait

Posted by Stamatis Zampetakis <za...@gmail.com>.
Hi Enrico,

I think a bit more context would help.

What kind of org.apache.calcite.schema.Table are you using in your Schema?
I suppose you already looked but just in case are there any kind of
statistics on these tables.
I've seen a similar case where the statistics of the table were declaring
that some columns were sorted without this being true.
I just want to make sure that this is not the case here.

Best,
Stamatis


Στις Σάβ, 22 Σεπ 2018 στις 11:43 π.μ., ο/η Enrico Olivelli <
eolivelli@gmail.com> έγραψε:

> Hi,
> We found a strange behaviour in an execution plan, basially we have an
> EnumerableMergeJoin which has as input two non-sorted
> EnumerableTableScan
>
> all the details are in this issue on HerdDB
>
> https://github.com/diennea/herddb/issues/262#issuecomment-423590573
>
> Cut and paste from the issue in the bottom of this email
>
> Any help is very appreciated, maybe some ring bells ....
>
> [ISSUE]
>
> query:
> SELECT * FROM license t0, customer c WHERE c.customer_id = t0.customer_id
>
> It seems that Calcite is planning a Merge Join, but the tables are not
> sorted according to the merge keys.
>
> "License" table:
> TABLE PK (non clustered): [license_id]
> COL: license_id serialPos: 0 (serialPos is the index of the colum for
> Calcite)
> COL: application serialPos: 1
> COL: creation serialPos: 2
> COL: data serialPos: 3
> COL: deleted serialPos: 4
> COL: modification serialPos: 5
> COL: signature serialPos: 6
> COL: customer_id serialPos: 7
>
> "Customer" table:
> TABLE PK (non clustered): [customer_id]
> COL: customer_id serialPos: 0
> COL: contact_email serialPos: 1
> COL: contact_person serialPos: 2
> COL: creation serialPos: 3
> COL: deleted serialPos: 4
> COL: modification serialPos: 5
> COL: name serialPos: 6
> COL: vetting serialPos: 7
>
> the join is on PK (non clustered) column of table customer,
> and the "customer_id" column of table 'license' which is not sorted
> naturally by 'customerid' (we do not have clustered indexes !!)
>
> This is the plan:
>
> EnumerableMergeJoin(condition=[=($7, $9)], joinType=[inner]): rowcount
> = 15.75, cumulative cost = {59.75 rows, 24.0 cpu, 0.0 io}, id = 114
> EnumerableTableScan(table=[[herd, license]]): rowcount = 15.0,
> cumulative cost = {15.0 rows, 16.0 cpu, 0.0 io}, id = 28
> EnumerableTableScan(table=[[herd, customer]]): rowcount = 7.0,
> cumulative cost = {7.0 rows, 8.0 cpu, 0.0 io}, id = 29
>
> EnumerableTableScan does not contain any information which tells that
> the Scan MUST be sorted according to the join keys (field 7 in
> "licence", and field 0 in "customer")
>
> Here in Calcite code the additional 'Collation' is lost as the
> "replace" does not contain any 'RelCollation', so the inputs of the
> join are not transformed
>
>
> https://github.com/apache/calcite/blob/2ab83e468d282a9428e533853aea5253816889fb/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableMergeJoinRule.java#L78
>
> is it a bug in Calcite or in how we are passing data to Calcite ?
> Tables do not have any impliticit "collation" in HerdDB so we are not
> passing any 'RelCollation'
>
>
> Thank you
>
> Enrico
>