Oracle9iR2 Data Warehousing

A common technique used in data warehouses is to precompute and store results of frequent queries. This is especially beneficial when the queries involve aggregation, because the result is usually much smaller than the detailed data used to produce the result. An example of such a query is a monthly sales report for the business. As multiple users are interested in the total sales of each product for each month, the data would be selected, joined, sorted, and aggregated over and over again for each user. Rather than wasting resources reexecuting the same query repeatedly, the result could be precomputed and saved in a table. Such precomputed results are often called summaries or summary tables.
Table 4.1 shows a summary containing the total number of items sold for each month of the year. Summary tables are usually much smaller than the tables containing the detail data. In this example, 17 rows of detailed sales transaction data is summarized into 10 rows. Depending on the data, the reduction in size and therefore the improvement in query performance can be quite significant.
| Detail Sales Transactions | ||
|---|---|---|
| Date | Customer | Product |
| 1/5/02 | Smith | Book |
| 1/6/02 | Jones | Tent |
| 2/5/02 | Smith | Book |
| 2/5/02 | Mills | Book |
| 3/5/02 | Smith | Film |
| 3/7/02 | Mills | Book |
| 3/5/02 | Smith | Film |
| 4/1/02 | Smith | Book |
| 4/2/02 | Jones | Book |
| 4/3/02 | Smith | Tent |
| 4/3/02 | Jones | Tent |
| 5/5/02 | Peters | Book |
| 5/6/02 | Smith | Book |
| 6/1/02 | Jones | Book |
| 6/5/02 | Smith | Tent |
| 6/6/02 | Jones | Tent |
| 6/5/02 | David | Tent |
| Total Sales by Product,... |
|---|