Database Systems · UGC NET: Data Warehousing and OLAP
OLAP Operations and Architectures
Overview
A data warehouse is a subject-oriented, integrated, time-variant and non-volatile store of data built to support management decisions, and OLAP (Online Analytical Processing) is the interactive, multidimensional analysis layer that sits on top of it.
OLTP systems run the day-to-day business; OLAP systems answer "what happened and why" across many dimensions at once.
This lesson covers the data cube model, the standard OLAP operations (roll-up, drill-down, slice, dice, pivot, drill-through), the OLAP server architectures (MOLAP, ROLAP, HOLAP), and the storage schemas (star, snowflake, fact constellation) that ROLAP uses.
You must already know basic relational tables, SQL grouping (GROUP BY), keys, and normalisation. In UGC NET the questions here are concept, numeric, statement-comparison and match-the-list type.
Key concepts
- Data warehouse (Inmon's definition): a subject-oriented, integrated, time-variant, non-volatile collection of data in support of management's decision-making process.
It stores summary and historical data that is rarely/never found in the operational environment. - Data mart: a small, department-scoped warehouse (e.g. Finance, Sales) containing summarised, de-normalised, aggregate departmental data. It may be dependent (fed from the warehouse) or independent (built directly from sources).
- OLTP: many short read-write transactions on current, detailed, volatile data; measured by throughput. OLAP: few complex read-only queries on historical, summarised, non-volatile data; measured by query response.
- OLAP is the market-oriented analysis tool used by knowledge workers — managers, executives, analysts — for multidimensional analysis, not transaction processing.
- Data cube: an n-dimensional array. Each dimension has a set of values and optionally a concept hierarchy; each cell holds an aggregate measure.
- Cuboid (summary table): an aggregation over a chosen subset of dimensions. The base cuboid keeps all n dimensions (most detail). The apex cuboid keeps zero dimensions and holds the single grand total.
All subsets form the lattice of cuboids. - Concept hierarchy: a many-to-one mapping such as day → month → quarter → year, or city → state → country, or product → category.
- Measures: additive (sum, count — summable across all dimensions), semi-additive (balance — summable across some dimensions only, e.g. not across time), non-additive (average, ratio, percentage).
- OLAP operations: roll-up (drill-up), drill-down (roll-down), slice, dice, pivot (rotate), drill-through, drill-across, push/rank, compute/aggregate.
- OLAP server architectures: MOLAP (multidimensional array storage), ROLAP (relational star/snowflake storage, SQL translation), HOLAP (hybrid split), DOLAP (desktop, client-side).
- Dimensional modelling (Kimball) is the design method that organises data into a fact table (measures + foreign keys) surrounded by dimension tables; its purpose is to define structures and store data so analytical queries answer efficiently.
- Materialisation options: full (all cuboids), partial/iceberg (only cells meeting a support threshold, e.g. count ≥ 10), or none (compute on demand).
How it works
A. Building and materialising the cube
- Extract data from heterogeneous operational sources.
- Clean/scrub it (correct errors, fill missing values, remove duplicates) — scrubbing happens before loading, never after.
- Transform into a unified scheme and load into the warehouse (the ETL pipeline).
- Model it dimensionally: pick the fact table (business events with numeric measures) and dimension tables (descriptive context).
- Aggregate along every subset of dimensions to produce the cuboids; decide full, partial or on-demand materialisation.
B. The lattice of cuboids
For dimensions {Time, Item, Location} the 8 cuboids are: {T,I,L} base, {T,I}, {T,L}, {I,L}, {T}, {I}, {L}, and { } apex. Each level up corresponds to one roll-up along that dimension's hierarchy or to dropping that dimension.
| Cuboid kept | Meaning | Typical query |
|---|---|---|
| {T, I, L} | base, full detail | sales of item X in store Y on day D |
| {T, I} | aggregated over Location | sales of item X on day D (all stores) |
| {T} | total sales per time | monthly totals |
| { } | apex, grand total | total sales of the company |
C. The six core operations (on a Sales cube with Time, Item, Location)
- Roll-up (drill-up): move up a concept hierarchy or drop a dimension — fewer, coarser cells. Example: city-level sales → country-level sales, or remove Time entirely.
- Drill-down (roll-down): the exact inverse — move down a hierarchy or add a dimension — more, finer cells. Example: annual → quarter → month; or add the Branch dimension back.
- Slice: fix one dimension to a single value, producing an -dimensional sub-cube. Example: Time = "2023-Q1".
- Dice: fix a range or set of values on two or more dimensions; the result keeps the same number of dimensions but fewer cells. Example: Product ∈ {rice, soap} AND Location ∈ {Delhi, Mumbai}.
- Pivot (rotate): re-orient the presentation — swap rows and columns, move a dimension onto the page axis. The data content is unchanged; only the view changes.
- Drill-through / drill-across: drill-through jumps from an aggregated cell to the underlying detail records (often relational rows outside the cube); drill-across combines cubes/fact tables that share dimensions.
A crosstab view displays exactly two dimensions at a time — one on rows, one on columns — with measures in the cells.
D. OLAP server architectures
- MOLAP: the server stores the cube as a multidimensional array (MDDB) with precomputed, indexed cells. Very fast for aggregation; suffers when the cube is sparse or very large.
- ROLAP: the server stores data in a relational star/snowflake schema and translates each OLAP operation into SQL (GROUP BY, WHERE). Scales to huge volumes; slower than MOLAP for dense aggregation.
- HOLAP: hybrid — detailed, atomic records live in the relational store, while high-level summary aggregations live in the MOLAP array. Balances scalability against speed.
- DOLAP: desktop OLAP — a slice of the cube is downloaded to the client and analysed locally.
E. Storage schemas used by ROLAP
- Star schema: one central fact table plus de-normalised dimension tables. Simple joins, fast.
- Snowflake schema: dimension tables are normalised into sub-dimensions (product → category → department). Less redundancy, more joins.
- Fact constellation (galaxy): several fact tables sharing dimension tables.
Drawing the diagram…
Drawing the diagram…
Formulas
- Let = number of dimensions, = number of distinct values per dimension, and assume no concept hierarchies unless stated.
- Base cuboid cells: .
- Total cells in a fully materialised cube (each dimension may also take the special value ALL, giving choices per dimension): .
- Number of cuboids in the lattice: .
- Number of cuboids other than the base: .
- Cells in a cuboid that keeps dimensions: (the apex cuboid, , has cell).
- Iceberg condition: keep a cell only if , where is the minimum support threshold.
Worked examples
Example 1 (numeric, hard). A cube has 4 dimensions — Time, Item, Branch, Location — each with exactly 5 distinct values and no concept hierarchies. Find (i) base cuboid cells, (ii) total cells if fully materialised, (iii) number of cuboids.
Step 1. Base cuboid: .
Step 2. Each dimension may also be "ALL", so choices per dimension: .
Step 3. Check by summation: . ✔
Step 4. Cuboids .
Answer: 625, 1296, 16.
Example 2 (operations). A Sales cube has dimensions Time, Product, City with hierarchies day→month→year and city→state→country. Current view: sales per month per product per city. State the operation for each request.
(a) Show sales per country per product → roll-up (climb the city → country hierarchy).
(b) Show sales per month per product only → roll-up by dimension reduction (drop City).
(c) From (b), show sales per day → drill-down (descend the time hierarchy).
(d) Show sales for January 2024 only → slice on Time (a 3-D cube becomes a 2-D Product × City cube).
(e) Show sales for products {rice, soap} in cities {Delhi, Mumbai} for all months → dice (ranges on two dimensions, still 3-D).
(f) Swap Product and City axes for readability → pivot.
Example 3 (numeric). In the cube of Example 1, a slice on Time = "2024" is taken. How many dimensions and how many base cells remain?
Step 1. Slice fixes one dimension → dimensions remain: Item, Branch, Location.
Step 2. Cells .
Answer: 3 dimensions, 125 cells.
Example 4 (statement type). Consider:
Statement I: Drill-down is the inverse of roll-up and may be performed either by stepping down a concept hierarchy or by adding a dimension.
Statement II: A slice reduces the number of dimensions by one, whereas a dice keeps the same number of dimensions but restricts their value ranges.
(A) Both true (B) Both false (C) I true, II false (D) I false, II true.
Reasoning. Both are the standard textbook definitions. Answer: (A).
Example 5 (match the list).
A. Drill-through — goes from an aggregated cell to the underlying detail records.
B. Apex cuboid — the zero-dimensional grand-total cuboid with one cell.
C. ROLAP — translates multidimensional operations into SQL over a star/snowflake schema.
D. MOLAP — stores precomputed cells in a multidimensional array.
So the correct pairing is A–detail, B–grand total, C–SQL translation, D–array storage.
Comparison
| Aspect | OLTP | OLAP |
|---|---|---|
| Purpose | run daily operations | support decisions |
| Data | current, detailed, volatile | historical, summarised, non-volatile |
| Operations | short insert/update/delete | complex read-only aggregation |
| Users | clerks, operators | managers, executives, analysts |
| Design | normalised (3NF) | dimensional (star/snowflake) |
| Unit of work | transaction | analytic query / cube cell |
| Feature | MOLAP | ROLAP | HOLAP |
|---|---|---|---|
| Storage | multidimensional array | relational tables | detail relational + summaries array |
| Speed | fastest for dense cubes | slower, SQL-bound | near-MOLAP for summaries |
| Scalability | limited by cube size/sparsity | very high | high |
| Query language | proprietary MDX-like | SQL | mixed |
| Operation | Effect on dimensions | Effect on cells |
|---|---|---|
| Roll-up | same or fewer | fewer, coarser |
| Drill-down | same or more | more, finer |
| Slice | minus one | fewer |
| Dice | unchanged | fewer |
| Pivot | unchanged | unchanged (view only) |
| Schema | Dimensions | Joins | Redundancy |
|---|---|---|---|
| Star | de-normalised | few | higher |
| Snowflake | normalised | many | lower |
| Fact constellation | shared | many | moderate |
Revision summary
- Warehouse = Subject-oriented, Integrated, Time-variant, Non-volatile — mnemonic SITN.
- Total cells ; base cuboid ; cuboids ; apex cell.
- Roll-up goes up, drill-down goes down; both can also work by dropping/adding a dimension.
- Slice = one dimension fixed, n−1 dims left; dice = ranges on two or more dimensions, dims unchanged.
- Pivot changes the view, never the data.
- Drill-through = aggregated cell → raw records; drill-across = across multiple fact tables.
- MOLAP = arrays; ROLAP = SQL over star schema; HOLAP = detail relational + summary array; DOLAP = desktop.
- A crosstab shows two dimensions at a time.
- Data scrubbing happens before loading, never after.
- Star = de-normalised, snowflake = normalised, galaxy = many facts.
- Data marts hold summarised, de-normalised, departmental aggregates.
Previous-year exam insights
- Direct definition questions ("X is subject-oriented, integrated, time-variant, non-volatile") — match every keyword to the warehouse, not to data mining or DBMS.
- Direct concept questions on which operation aggregates via a concept hierarchy or dimension reduction (roll-up) and which fixes one dimension (slice); learn the four operation definitions verbatim.
- Numeric cube-cell questions: check first whether hierarchies exist and whether the question asks for the base cuboid or the fully materialised cube — the trap is answering when is wanted, or forgetting the apex cuboid.
- Architecture questions contrast MOLAP, ROLAP and HOLAP on storage medium and scalability; a common wrong option claims ROLAP stores precomputed arrays.
- Statement I/II questions pair OLAP with knowledge workers and managers and contrast it with OLTP's transaction processing; usually both true or one trivially false.
- Match-the-list items pair MOLAP → MDDB, ROLAP → SQL translation, drill-through → underlying detail, apex → grand total.
- Slice vs dice is a favourite trap: dice does not reduce dimensionality.
- Data-mart questions expect "All of the above" when the options are summarised data, de-normalised data and departmental aggregates.
Practice at PARIKSHA
You are ready for the PARIKSHA tests of this sub-topic when you can:
- State the SITN definition of a data warehouse and explain each keyword in one line.
- Compute base-cuboid cells, fully materialised cells and the number of cuboids for given and .
- Identify from a plain-English requirement whether the answer is roll-up, drill-down, slice, dice or pivot.
- Explain why dice keeps the dimensionality while slice reduces it by one.
- Distinguish MOLAP, ROLAP, HOLAP and DOLAP on storage medium, speed and scalability.
- Draw and label a star schema and a snowflake schema for a small retail case and say which has more joins.
- Explain what drill-through does and how it differs from drill-across.
- Reproduce the lattice of cuboids for three dimensions and label the base and apex.
- Compare OLTP and OLAP across purpose, data, operations, users and schema in a table.
- Decide true/false for paired statements on OLAP operations and architectures.
Attempt the sub-topic test on OLAP operations and architectures first, then the full Data Warehousing and OLAP subject test.