cmu-db / optd

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

feat: add cost estimation for agg #144

Closed Gun9niR closed 7 months ago

Gun9niR commented 7 months ago

Compute cost for aggregation. The cardinality is computed as the product of n-distinct of all the group-by columns. If there's no group by column, the output cardinality is just 1.

This should fix the cardinality parity between postgres for Q14 and Q17. It also leads to a better join order in Q11, since aggregation is the child of a join.

Misc

wangpatrick57 commented 7 months ago

Oh one more thing, could you update the q-errors in #127 after each PR? This way, we always know which PR caused which changes to the q-errors? I noticed that you marked Q14 as fixed but didn't update dfcard