calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Victor Giannakouris - Salalidis <>
Subject HepPlanner: Optimal Plan Generation
Date Thu, 18 Feb 2016 07:00:57 GMT
Hello. I am trying to implement a planner in order to generate optimal
logical query plans using some statistics I provide to the schema.
Currently, the only available statistics is the number of rows of each

I am using HepPlanner. My actual problem is that when the *findBestExp()*
is called, the resulting plan is not optimized. That is, the query is just
parsed and the join order is the same as the one I provide in the input
query, neither filter push downs are being applied.

For example, for the query

"SELECT * FROM ftable f, products p WHERE = AND = 2"

the resulting plan is:

12:LogicalProject(id=[$0], desc=[$1], price=[$2], loc=[$3], pid=[$4],
pdesc=[$5]): rowcount = 225000.0, cumulative cost = 1.05002E7
  10:LogicalFilter(condition=[AND(=($0, $4), =($4, 2))]): rowcount =
225000.0, cumulative cost = 1.02752E7
    8:LogicalJoin(condition=[true], joinType=[inner]): rowcount = 1.0E7,
cumulative cost = 1.00502E7
      0:EnumerableTableScan(table=[[fTable]]): rowcount = 50000.0,
cumulative cost = 50000.0
      1:EnumerableTableScan(table=[[products]]): rowcount = 200.0,
cumulative cost = 200.0

I implemented this using Hive's
as examples and there are some classes or overrided methods which I
currently use as “black boxes”. Here is a link with the code of my basic

Victor Giannakouris - Salalidis

Personal Page:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message