risinglightdb / risinglight

An educational OLAP database system.
Apache License 2.0
1.59k stars 211 forks source link

chore: add rule and test #851

Closed caicancai closed 3 months ago

caicancai commented 3 months ago

I noticed that risinglight uses egg for CBO optimization, but it looks violent at the moment. I will try to optimize it.

caicancai commented 3 months ago

cc @wangrunji0408 If you have time, could you help me review this PR? Thank you.

caicancai commented 3 months ago

@wangrunji0408 PATL, thank you

caicancai commented 3 months ago

@wangrunji0408 I would like to ask a question, can egg+sql optimization be extracted into a separate framework and then integrated with calcite? Do you think this is feasible?

wangrunji0408 commented 3 months ago

can egg+sql optimization be extracted into a separate framework and then integrated with calcite? Do you think this is feasible?

I'm not sure as the Calcite is written in Java while egg is designed for Rust. Besides, what's the purpose of doing this? As far as I know, the Calcite itself is a framework for optimization. I have always thought of egg as a Rust alternative of Calcite.

caicancai commented 3 months ago

I'm not sure as the Calcite is written in Java while egg is designed for Rust. Besides, what's the purpose of doing this? As far as I know, the Calcite itself is a framework for optimization. I have always thought of egg as a Rust alternative of Calcite.

I think it is a bit complicated to expand an optimization rule in Calcite at present, and it is not as convenient as egg. My original intention is to make Calcite more convenient to use.