cmu-db / optd

CMU-DB's Cascades optimizer framework
https://cmu-db.github.io/optd/
MIT License
373 stars 22 forks source link

fix: compute children correlation in compute_cost #176

Closed Gun9niR closed 6 months ago

Gun9niR commented 6 months ago

The input logical property of a group is not fixed. For example, with semantic correlation, a join b join c, has a = b = c as output correlation, but the input might be a = b, a = c, or b = c depending on which join is performed first. Right now, we just take the first expr in the group as the input, which is why we are getting the bug that the equal columns from semantic correlation are the same as the join condition.

We should reconstruct the input eq columns during compute_cost using children's group id, not during building logical property.