|
|
| |
 |
|
Oracle Tips
by Burleson Consulting
|
The Data Warehouse Development Life Cycle
Aggregating Data For The Oracle Warehouse
Using SQL To Create Summary Tables
If we created a metadata table that contained each
possible dimension, it would be easy to write a PL/SQL routine to
dynamically re-create and populate the 45 summary tables that are
required. The pseudo-code for such a routine might look something
like this:
DECLARE CURSOR c1 AS
SELECT dimension_name FROM dimensions ORDER BY dimension_name;
FOR EACH outer_dimension
REPEAT
OPEN CURSOR c1;
FETCH c1 INTO dimension_one;
DECLARE CURSOR c2 AS
SELECT dimension_name FROM dimensions ORDER BY dimension_name;
FOR EACH inner_dimension
REPEAT;
OPEN CURSOR c2;
FETCH c2 INTO dimension_two;
CALL create_SQL (dimension_one, dimension_two);
NEXT inner_dimension
NEXT outer_dimension
In this fashion, we could create all 45 summary tables each night
immediately after our new values have been loaded. But will all of
these tables be needed by our end users? Because a complete
pre-calculation of 45 tables is not an overwhelming task, we may
decide that we can afford to have all possible summary table
combinations available to our end users.
On the surface, it appears that SQL can be used against
two-dimensional tables to handle three-dimensional time-series
problems. It also appears that SQL can be used to roll up
aggregations at runtime, alleviating the need to do a roll up at
load time, as with a traditional database. While this implementation
does not require any special multidimensional databases, the
following two important issues remain to be resolved:
* Performance--Joining a table against itself (especially
when comparing ranges of dates) may create many levels of nesting in
the SQL optimization resulting in poor response time.
* Ability--No end user would be capable of formulating this
type of sophisticated SQL query.
If you strip away all of the marketing hype and industry jargon, you
can see that a data warehouse and a multidimensional database can be
easily simulated by pre-creating many redundant tables, each with
pre-calculated roll-up information. In fact, the base issue is
clear--complex aggregation needs to be computed at runtime or when
data is loaded.
 |
Expert Remote DBA
BC is America's oldest and largest Remote DBA Oracle support
provider. Get real Remote DBA experts, call
BC Remote DBA today. |
 |
|
|
|
|