Data Warehousing and Data Mining · Unit 4 · 4 hrs
Data Cube Technology
Exam-focused notes for Data Cube Technology (Data Warehousing and Data Mining, CSC420): what the TU syllabus asks and how it has actually been tested, with 7 solved past questions from this unit.
Data Cube Technology in short
Precomputing a data cube can dramatically cut the response time of an OLAP query, but computing and storing every possible aggregate can just as easily exhaust available memory. This unit covers how a cube's cuboids are organized and materialized, the general strategies used to compute them efficiently, and the query-oriented alternative to cube precomputation, attribute-oriented induction, used to compare one class of data against another.
What this unit covers
- Efficient method for data cube computation
- Cube materialization (Introduction to Full cube, Iceberg cube, Closed cube, Shell cube)
- General strategies for cube computation
- Attribute oriented induction for data characterization
- Mining class comparison
- Discriminating between different classes
General strategies for cube computation
2081 · 5 marks
Explain the general strategies for cube computation. [5]
2076 · 5 marks
Explain the optimization techniques in data cube computation. [5]
Attribute oriented induction for data characterization
2081 · 5 marks
Distinguish between data characterization and data discrimination. What are the challenges of multimedia mining? [5]
Cube materialization
2080 · 5 marks
How many cuboids are possible from 5-dimensional data? Discuss the concept of full cube and iceberg cube. [5]
Show solved answerHide answer
Cuboids from 5-Dimensional Data, Full Cube, and Iceberg Cube
Given
- Number of dimensions: $n = 5$
- (No concept hierarchies specified, so we assume one level per dimension.)
Solution
Number of Cuboids
A data cube of $n$ dimensions (without concept hierarchies) contains $2^n$ cuboids, because each dimension can either be included or excluded from a given group-by.
$$\text{Number of cuboids} = 2^n = 2^5 = 32$$
Breakdown by level (using dimensions A, B, C, D, E):
| Level | No. of Cuboids | $\binom{5}{k}$ | Examples |
|---|---|---|---|
| 5-D (Base) | 1 | $\binom{5}{5}$ | ABCDE |
| 4-D | 5 | $\binom{5}{4}$ | ABCD, ABCE, ABDE, ACDE, BCDE |
| 3-D | 10 | $\binom{5}{3}$ | ABC, ABD, ... |
| 2-D | 10 | $\binom{5}{2}$ | AB, AC, ... |
| 1-D | 5 | $\binom{5}{1}$ | A, B, C, D, E |
| 0-D (Apex) | 1 | $\binom{5}{0}$ | ( ) = "all" |
| Total | 32 | $2^5$ |
- The base cuboid (ABCDE) is the least generalized and holds the most detailed data.
- The apex cuboid (0-D) is the most generalized, holding a single aggregate value.
Note: If each dimension had an associated concept hierarchy with $L_i$ levels, the total would instead be $\prod_{i=1}^{n}(L_i + 1)$. With no hierarchy given, the answer is $2^5 = 32$.
Full Cube
A full cube is a data cube in which all cuboids (all $2^n$ group-by combinations) and all their cells are precomputed and materialized in advance.
- For 5 dimensions, all 32 cuboids are precomputed.
- Advantage: Queries are answered very fast, since every aggregation is already available.
- Disadvantage: Requires very large storage and computation; grows explosively with dimensions and concept hierarchies, making it impractical for high-dimensional or sparse data.
Iceberg Cube
An iceberg cube is a partially materialized cube that stores only those cells whose aggregate measure value satisfies a specified minimum threshold (the iceberg condition / minimum support).
- Only cells meeting a condition such as
count >= min_suporsum(sales) > thresholdare stored. - Cells below the threshold (typically the vast majority in sparse data) are discarded.
- The name "iceberg" reflects that only the significant "tip" is materialized, while the large insignificant bulk stays hidden.
- Benefit: Greatly reduced storage and computation while retaining the useful (frequent/significant) aggregates.
Comparison
| Feature | Full Cube | Iceberg Cube |
|---|---|---|
| Cells/cuboids stored | All ($2^n$ cuboids, all cells) | Only cells above threshold |
| Memory usage | Very high | Significantly reduced |
| Query speed | Fast | Fast for significant cells |
| Best use case | Low dimensionality | Large, sparse, high-dimensional data |
Summary
For 5-dimensional data there are $2^5 = 32$ possible cuboids. A full cube precomputes all 32 cuboids (high storage cost), whereas an iceberg cube materializes only cells whose measure exceeds a minimum threshold, saving substantial space and computation.
2078 · 5 marks
What are the choices for data cube materialization? Explain the strategies for cube computation. [5]
Show solved answerHide answer
Data Cube Materialization: Choices and Strategies for Cube Computation
Introduction
Data cube computation is an essential task in data warehouse implementation. The precomputation (materialization) of all or part of a data cube can greatly reduce response time and enhance OLAP performance. However, it is challenging because it may require huge computational time and storage space.
Choices for Data Cube Materialization
There are three main choices for data cube materialization:
1. Full Materialization
- All cuboids in the data cube lattice are precomputed and stored.
- Provides the fastest query response time since all aggregations are already computed.
- Disadvantage: Requires enormous storage space and high computation cost, especially when the number of dimensions is large.
2. No Materialization
- No cuboids are precomputed; all queries are computed on-the-fly from the base cuboid (raw data).
- Disadvantage: Very slow query response time, especially for complex OLAP queries on large datasets.
3. Partial Materialization
- Only a selected subset of cuboids is precomputed and stored.
- Provides a balance between storage cost and query response time.
- This is the most practical and widely used approach.
Strategies for Cube Computation
i) Full Cube Computation
- Computes every possible cuboid for all combinations of dimensions.
- For an n-dimensional data cube, the total number of cuboids is 2^n.
- Suitable only when n is small and storage is not a constraint.
ii) Iceberg Cube
- Instead of computing the complete cube, only those cuboids (cells) that satisfy a minimum support threshold (called the iceberg condition) are computed.
- Cells with aggregate values below the threshold are discarded.
- Example condition:
HAVING count(*) >= min_support - This avoids computing and storing many low-value, sparse cells, saving both time and space.
- The name comes from the idea that only the "tip of the iceberg" (the significant aggregates) is materialized.
iii) Shell Cube (Partial Materialization)
- A strategy for partial materialization where only cuboids involving a small number of dimensions (such as 3 to 5) are precomputed.
- These precomputed cuboids form a shell cube.
- For example, in an n-dimensional data cube, we could compute all cuboids with 3 dimensions or less, resulting in a Shell Cube of size 3.
- Remaining higher-dimensional cuboids are computed on-the-fly using the precomputed shell cuboids.
- Advantage: Significantly reduces storage while still speeding up many common queries.
iv) Closed Cube
- Only closed cells are materialized. A cell is closed if there is no supercell with the same measure value (e.g., same count).
- Reduces redundancy in stored data by avoiding cells whose values can be directly derived from a more specific cell.
Summary Table
| Strategy | What is Stored | Storage Cost | Query Speed |
|---|---|---|---|
| Full Materialization | All cuboids | Very High | Very Fast |
| No Materialization | None | None | Very Slow |
| Iceberg Cube | Cells above threshold | Low | Fast |
| Shell Cube | Cuboids with few dimensions | Medium | Moderate |
| Closed Cube | Non-redundant closed cells | Low | Fast |
Conclusion
Among all strategies, partial materialization (especially Iceberg Cube and Shell Cube) provides the best trade-off between storage cost and query performance, making them the most practical choices for real-world data warehouse implementations.
Efficient method for data cube computation
2079 · 5 marks
Suppose that we have 5 dimensional data. What will be total number of cuboids generated? If we consider each dimension has 5 levels, what will be the number of cuboids generated? [5]
2075 · 5 marks
Describe the significances of pre-computation of data cube. [5]
Make Unit 4 stick
Practice CSC420 with flashcards & quizzes