zhouqingqing / qpmodel

A Relational Optimizer and Executor
MIT License
64 stars 18 forks source link

teach all expression in the same use the same card #195

Closed zhouqingqing closed 3 years ago

zhouqingqing commented 3 years ago

Expressions in the same group logically shall have the same cardinality. This is not guaranteed however if we compute CE for both AxBxC and AxCxB - because the join CE formula does guarantee association. To fix this, we compute the first expression in the group and set all others to this value. This is not perfect though, as the order of expression in the group actually decides the cardinality.