We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Databases
- OLAP
- OLAP Operation Types
- Discussions
OLAP Operation Types
OLAP Operation Types
Sort by
recency
|
20 Discussions
|
Please Login in order to post a comment
Thats rollup and cartessian
I have answered 3 times wrong, is there a chance to retry it again ?
Hello, I have answered 3 times wrong, is there a chance to retry it again ? Thanks
Just (4, 7, 3, 84, 160, 117)
Group By ROLLUP produces a*((b+1)(c+1)) + 1 rows. This is because if we have ROLLUP(D1,D2,D3) we can decompose it to ROLLUP(D1,D2), that has a(b+1) +1 rows, because we can think about it as the cartesian product between D1 and (D2 + NULL item), plus the NULL,NULL final row. So with ROLLUP(D1,D2,D3), we know that each D1 row can be grouped with b rows of D2, that is {(D1.1, D2.1),...,(D1.1,D2.b),....} but then, each D2.x row, can be combined with c rows of D3, that is {(D1.1, D2.1,D3.1),...,(D1.1,D2.b, D3.c),...}. But, we'll have for each D2 row also the tuple (D1.x, D2.y_, NULL), and for each D1 row the tuple (D1.x,NULL,NULL), that results in the a*[b*(c+1)+1]+1 final formula.
with D1,D2,D3,D4 columns, and D4 with d distinct values, ROLLUP(D1,D2,D3,D4) generates a*[b*[c*(d+1)+1]+1] + 1 rows.
GROUP BY CUBE instead is the cartesian product of (a+1)(b+1)(c+1), since (a+1), etc.. are all the current rows plus the NULL value.