Page 176 -
P. 176

11-ch04-125-186-9780123814791
                                                                     3:17 Page 139
                                                            2011/6/1
                         HAN
                                                                                    #15
                                                   4.2 Data Warehouse Modeling: Data Cube and OLAP  139


                                                         all                       0-D (apex) cuboid




                                                    item    location                   1-D cuboids
                                                    Item
                                                            location
                                        time                             supplier
                                                   time, supplier  item, supplier
                                                   time, supplier
                                                                 item, supplier
                                 time, item                                  location,  2-D cuboids
                                           time, location  item, location    supplier
                                           time, location
                                                          item, location
                                                        time, location, supplier       3-D cuboids
                                                        time, location, supplier
                               time, item, location
                                                time, item, supplier
                                                                         item, location,
                                                                         supplier
                                                time, item, location, supplier     4-D (base) cuboid


                     Figure 4.5 Lattice of cuboids, making up a 4-D data cube for time, item, location, and supplier. Each
                               cuboid represents a different degree of summarization.



                         4.2.2 Stars, Snowflakes, and Fact Constellations: Schemas for
                               Multidimensional Data Models

                               The entity-relationship data model is commonly used in the design of relational
                               databases, where a database schema consists of a set of entities and the relationships
                               between them. Such a data model is appropriate for online transaction processing.
                               A data warehouse, however, requires a concise, subject-oriented schema that facilitates
                               online data analysis.
                                 The most popular data model for a data warehouse is a multidimensional model,
                               which can exist in the form of a star schema, a snowflake schema, or a fact constellation
                               schema. Let’s look at each of these.

                               Star schema: The most common modeling paradigm is the star schema, in which the
                                 data warehouse contains (1) a large central table (fact table) containing the bulk of
                                 the data, with no redundancy, and (2) a set of smaller attendant tables (dimension
                                 tables), one for each dimension. The schema graph resembles a starburst, with the
                                 dimension tables displayed in a radial pattern around the central fact table.

                  Example 4.1 Star schema. A star schema for AllElectronics sales is shown in Figure 4.6. Sales are con-
                               sidered along four dimensions: time, item, branch, and location. The schema contains
                               a central fact table for sales that contains keys to each of the four dimensions, along
   171   172   173   174   175   176   177   178   179   180   181