db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Db-derby Wiki] Update of "OLAPRollupLists" by BryanPendleton
Date Thu, 09 Aug 2007 16:42:15 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Db-derby Wiki" for change notification.

The following page has been changed by BryanPendleton:
http://wiki.apache.org/db-derby/OLAPRollupLists

------------------------------------------------------------------------------
  }}}
  The above grammar is just a tiny subset of the overall GROUP BY grammar, namely those parts
that involve ROLLUP.
  
+ == Current GROUP BY implementation ==
+ 
+ The current implementation of GROUP BY aggregation is (over-simplified, but hopefully accurate):
+ 
+  * Determine the rows to be grouped, by executing the indicated query
+  * For each row, augment the row with additional hidden columns which hold information about
the aggregation to be performed (SUM, MAX, COUNT, etc.)
+  * Sort the rows by the grouping columns, eliminating duplicates during the sort
+  * Each time a duplicate row is eliminated, aggregate its information into the row which
the sorter retains
+  * At the end of the sort, there is one remaining row for each distinct set of values of
the grouping columns, and the augmented aggregation columns in that row hold the computed
aggregate values.
+ 
+ Thus aggregate computation is a side-effect of sorting and duplicate elimination.
+ 

Mime
View raw message