|
 |
|
STAR Schema Design
Oracle Tips by Burleson Consulting |
The Data Warehouse Development Life Cycle
Oracle Data Warehouse Design
Massive De-normalization: STAR
Schema Design
Note the dimension tables
surrounding the fact table. Some of the dimension tables contain
data that can be added to queries with joins, while other dimensions
such as REGION do not contain any data, and only serve as
indexes to the data.
Considering the huge disk space
consumption and read-only restriction, what does this STAR schema
really buy for us? The greatest benefit of the STAR schema is the
simplicity of data retrieval. Now that we have a STAR schema, we can
formulate SQL queries to quickly get the information we desire. For
example, we can use the following simple query to get the total cost
for an order :
SELECT sum(total_cost) order_total
FROM FACT
SEE CODE DEPOT FOR FULL SCRIPT
By doing some of the work up front,
the realtime query becomes both faster and simpler.
Now, let's consider what would
happen if the user of this schema wanted to analyze information by
aggregate values. Assume our manager wants to know the breakdown of
sales by region. The data is not organized by region, but the fact
table can easily be queried to find the answer.
At this point, retrieving the sum of
all orders for the Western region becomes trivial, as shown in the
following snippet:
SELECT
sum(total_cost)
FROM FACT
SEE CODE DEPOT FOR FULL SCRIPT
In addition to making the query
simpler in structure, all of the table joining has been eliminated,
so we can easily get the extracted information from our STAR schema.
Note: A value such as REGION
would be an ideal candidate for the use of Oracle7.3 bitmapped
indexes. Columns that have a small number of
distinct values can see dramatic performance improvements by
utilizing the bitmapped index technique. Bitmapped indexes are
described in detail in Chapter 8, Oracle Features For The Data
Warehouse.
The natural consequence of this
approach is that many IS shops will keep two copies of their
production databases: one in third normal form for online
transaction processing and another de-normalized version of the
database for decision support and data warehouse applications.
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. |
|