Usage of Volcano or HepPlanner

2018-05-11 Thread Davide Lanti

Dear devs,

I am trying to use the HepPlanner, but apparently it does not apply 
rules according to the cost model (in my case, it simply applies all 
applicable rules).


Do I need the VolcanoPlanner to obtain a cost-based query transformation?

Best, Davide.



Re: Using Calcite for query planning

2018-02-15 Thread Davide Lanti

Ok,

thank you very much Julian, we'll try it out.

Best regards, Davide and Guohui.


On 14/02/18 19:42, Julian Hyde wrote:

It sounds like a good fit. Parse the SQL, translate to relational algebra, 
apply some query transformation rules on the algebra.

If you have a few simple transformations in mind, you may be able to achieve it 
without a cost model. Or, as you propose, a simple model based on cardinality.

To convert a union of conjunctive queries to a conjunction of possibly-union 
queries, you would probably need a rule called UnionJoinTransposeRule that 
converts

   (Union (Join X Y) (Join X Y))

into

   (Join X (Union Y Z))

or something like that, and combines it with some existing rules to push 
unions. There is currently no such rule but it would not be hard to write.

Julian



On Feb 14, 2018, at 5:24 AM, Guohui Xiao  wrote:

Hi,

We are considering using Calcite to perform cost-based query optimization
in our project.

Specifically, we can already generate some SQL queries expressed in some
relational algebra expression through our API, and we want to optimize the
generated expressions using Calcite.

We have a cost model based on cardinality estimation. We want to use it to
convert e.g., a union of conjunctive queries (UCQ) into a a join of UCQs.

We would like to understand how much efforts are needed to realize our idea
using Calcite.

Do you have suggestions about this?

Thanks in advance.

Best regards,

Guohui & Davide



--
Guohui Xiao, PhD
Assistant Professor with a fixed-term contract
KRDB - Faculty of Computer Science
Free University of Bozen-Bolzano
Piazza Domenicani, 3
I-39100 Bolzano, Italy

http://www.ghxiao.org