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
Add planner test for Q11.
Fixes Q14 and Q17.
Next step is to support n-distinct for string.
We may change to multi-dimension n-distinct after it's integrated.
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
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