Created
January 2, 2014 18:20
-
-
Save davidfetter/8223770 to your computer and use it in GitHub Desktop.
GROUPING SETS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ROLLUP | |
SELECT count(a), sum(b), count(c) FROM table1 GROUP BY ROLLUP(a,b,c); | |
Grouping order: | |
GROUP BY (a,b,c) | |
GROUP BY (a,b) | |
GROUP BY (a) | |
GROUP BY () | |
1) Add a new member for holding the number of GROUPING SETS. For ROLLUP, this will be equal to number of grouping columns + 1. <--a new member of what? | |
2) Currently, There is a AggStatePerGroupData GROUP per aggregate. This will be changed to a AggStatePerGroupData per GROUPING SET per GROUP pe Aggregate. This means that the number of AggStatePerGroupData instances for a query will be number 0f aggregates * number of grouping sets. Number of grouping sets is number of grouping columns + 1. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment