|
 |
|
Aggregating Data For The Oracle Warehouse
Oracle Tips by Burleson Consulting |
The Data Warehouse Development Life Cycle
Aggregating Data For The Oracle Warehouse
Alternate Summary Data Formats
Of course, the other tables are two dimensional--comparing one
dimension against the other--but these table definitions can easily
be massaged by an application to provide a tabular representation of
several dimension attributes. Table 6.2 presents a tabular display
of item_type against region, much as a multidimensional database
would present these summaries.
Clothes Food
Hardware
West $113,999
$23,574 $56,335
East
$45,234 $835,342
$66,182
North $826,463
$43,383 $77,261
South $1,223
$9,281 $56,392
Table 6.2 region versus type.
But what if management wants to look at quarterly summaries instead
of monthly summaries? What about yearly summaries? Of course, this
same technique can be used to roll up the monthly summary tables
into quarterly summaries, yearly summaries, and so on, according to
the demands of end users.
Just as the fact table is time based, aggregate tables can be time
based, and the ranges of times can be specified, as shown in the
following code:
SELECT SUM(cost*qty), store_id
FROM sale_fact
SEE CODE DEPOT FOR FULL SCRIPT
GROUP BY store_id;
Remember, all data warehouse fact tables are usually ordered by some
kind of data, and it makes sense that aggregate tables will also be
ordered by a date.
This is an excerpt from "High Performance
Data Warehousing", copyright 1997.
 |
If you like Oracle tuning, you may enjoy the book
Oracle Tuning: The Definitive Reference , with over 900 pages of BC's favorite tuning
tips & scripts.
You can buy it directly from the publisher and save 30%, and get
instant access to the code depot of Oracle tuning scripts. |
|
|