Hi,

I have two questions:

1)When trying to optimize the join order of a query what rules should I
use? For example I have this query:
"select s.orders.productid  "
+ "from  s.products, s.customers,s.orders "
+ "where s.orders.productid = s.products.productid and "
                                + "s.customers.customerid=s.orders.
customerid  "
with these sizes => orders[15 rows] , products [5 rows], orders[10 rows]. I
am using  the heuristicPlanner with these rules for join :
    this.hepPlanner.addRule(JoinToMultiJoinRule.INSTANCE);
    this.hepPlanner.addRule(LoptOptimizeJoinRule.INSTANCE);
    this.hepPlanner.addRule(MultiJoinOptimizeBushyRule.INSTANCE);
    this.hepPlanner.addRule(JoinPushThroughJoinRule.LEFT);

but nothing happens, and the final logical plan changes according to the
order I define the tables after FROM in the query. Is there something I am
missing? What would the LoptOptimizeJoinRule do?

2)Is it possible to change the cost model of project,filter,aggregate and
join to a rate-based, from which I want to get the maximum rate instead of
the minimum cost for optimization? Should I create new rules or override
the old ones? Any hints on where to start?

2016-10-10 15:33 GMT+03:00 Γιώργος Θεοδωράκης <giwrgosrth...@gmail.com>:

> Hello,
>
> I am trying to optimize the logical/physical plan of a given streaming
> query with Calcite and execute it in a separate engine. So far, I am using
> heuristic planner and some cost-based push-down rules and get a
> "relational" optimization on the plan. By relational, I mean that this is
> basic optimization that I would get if my query was executed in a
> relational database and wasn't a stream. As a result I am not optimizing
> the query with streaming criteria at all.
>
> Can someone give any suggestions on further optimization on streaming
> queries? Is there anything more to do using Calcite, or the optimization
> ends by using the built in rules? Finally, any related work would be
> welcome.
>
> Thanks in advance,
> George.
>

Reply via email to