Presentation is loading. Please wait.

Presentation is loading. Please wait.

Data Warehousing and Decision Support courtesy of Jiawei Han, Larry Kerschberg, and etc. for some slides. Jianlin Feng School of Software SUN YAT-SEN UNIVERSITY.

Similar presentations


Presentation on theme: "Data Warehousing and Decision Support courtesy of Jiawei Han, Larry Kerschberg, and etc. for some slides. Jianlin Feng School of Software SUN YAT-SEN UNIVERSITY."— Presentation transcript:

1 Data Warehousing and Decision Support courtesy of Jiawei Han, Larry Kerschberg, and etc. for some slides. Jianlin Feng School of Software SUN YAT-SEN UNIVERSITY

2 August 25, 2015 Data Mining: Concepts and Techniques 2 Outline Data Warehouse: Basic Concepts Data Warehouse Modeling: Data Cube and OLAP Summary

3 August 25, 2015 Data Mining: Concepts and Techniques 3 What is a Data Warehouse? Defined in many different ways, but not rigorously.  A decision support database that is maintained separately from the organization’s operational database  Support information processing by providing a solid platform of consolidated, historical data for analysis. “A data warehouse is a subject-oriented, integrated, time-variant, and nonvolatile collection of data in support of management’s decision- making process.”—W. H. Inmon Data warehousing:  The process of constructing and using data warehouses

4 August 25, 2015 Data Mining: Concepts and Techniques 4 Data Warehouse—Subject-Oriented Organized around major subjects, such as customer, product, sales Focusing on the modeling and analysis of data for decision makers, not on daily operations or transaction processing Provide a simple and concise view around particular subject issues by excluding data that are not useful in the decision support process

5 August 25, 2015 Data Mining: Concepts and Techniques 5 Data Warehouse—Integrated Constructed by integrating multiple, heterogeneous data sources  relational databases, flat files, on-line transaction records Data cleaning and data integration techniques are applied.  Ensure consistency in naming conventions, encoding structures, attribute measures, etc. among different data sources E.g., Hotel price: currency, tax, breakfast covered, etc.  When data is moved to the warehouse, it is converted.

6 August 25, 2015 Data Mining: Concepts and Techniques 6 Data Warehouse—Time Variant The time horizon for the data warehouse is significantly longer than that of operational systems  Operational database: current value data  Data warehouse data: provide information from a historical perspective (e.g., past 5-10 years) Every key structure in the data warehouse  Contains an element of time, explicitly or implicitly  But the key of operational data may or may not contain “time element”

7 August 25, 2015 Data Mining: Concepts and Techniques 7 Data Warehouse—Nonvolatile A physically separate store of data transformed from the operational environment Operational update of data does not occur in the data warehouse environment  Does not require transaction processing, recovery, and concurrency control mechanisms  Requires only two operations in data accessing: initial loading of data and access of data

8 August 25, 2015 Data Mining: Concepts and Techniques 8 OLTP vs. OLAP

9 August 25, 2015 Data Mining: Concepts and Techniques 9 Why a Separate Data Warehouse? High performance for both systems  DBMS— tuned for OLTP: access methods, indexing, concurrency control, recovery  Warehouse—tuned for OLAP: complex OLAP queries, multidimensional view, consolidation Different functions and different data:  missing data: Decision support requires historical data which operational DBs do not typically maintain  data consolidation: DS requires consolidation (aggregation, summarization) of data from heterogeneous sources  data quality: different sources typically use inconsistent data representations, codes and formats which have to be reconciled Note: There are more and more systems which perform OLAP analysis directly on relational databases

10 August 25, 2015 Data Mining: Concepts and Techniques 10 Data Warehouse: A Multi-Tiered Architecture Data Warehouse Extract Transform Load Refresh OLAP Engine Analysis Query Reports Data mining Monitor & Integrator Metadata Data Sources Front-End Tools Serve Data Marts Operational DBs Other sources Data Storage OLAP Server

11 August 25, 2015 Data Mining: Concepts and Techniques 11 Extraction, Transformation, and Loading (ETL) Data extraction  get data from multiple, heterogeneous, and external sources Data cleaning  detect errors in the data and rectify them when possible Data transformation  convert data from legacy or host format to warehouse format Load  sort, summarize, consolidate, compute views, check integrity, and build indicies and partitions Refresh  propagate the updates from the data sources to the warehouse

12 August 25, 2015 Data Mining: Concepts and Techniques 12 Outline Data Warehouse: Basic Concepts Data Warehouse Modeling: Data Cube and OLAP Data Warehouse Design and Usage Data Warehouse Implementation Summary

13 Data Cube Concept Data Cube: A Relational Aggregation Operator Generalizing Group-By, Cross- Tab and Sub-Totals  By Jim Gray et al, in IEEE ICDE’1996

14 CUBE: A Relational Aggregate Operator Generalizing Group By (from Gray, et al)

15 Data Analysis Tasks Formulate a query to extract relevant information Extract the aggregated data from the database into a file. Visualize the result to look for patterns. Analyze the result and perhaps formulate new queries.

16 Goal of the Cube Represent N-dimensional data cubes using 2-D relations Compute the aggregate information within the database, Create language extensions to SQL that will support the required operations.

17 Relational Representation of N-Dimensional Data Weather information consists of four dimensions: Time, Latitude, Longitude and Altitude Measured variables are Temperature and Pressure. SQL 1992 Standard supports aggregation functions : Count (), Sum(), Min(), Max() and AVE(); Some SQL systems have Median, Standard Deviation, variance, etc. SELECT AVE(Temp) FROM Weather SELECT COUNT(DISTINCT Time) FROM Weather

18 SELECT Time, Altitude, AVE(Temp) FROM Weather GROUP BY Time, Altitude Group-By Operation and Aggregates Group-By operation defines an equivalence relation on a table, partitioning the tuples in classes having the same attribute values. Each group can then be aggregated. TCP-D has one 6D GROUP BY and three 3D GROUP Bys.

19 Problems with GROUP-BY Group-By cannot directly construct:  Histograms,  Roll-up Totals, Sub-totals for Drill-downs, and  Cross Tabulations.

20 Roll-Ups and Sub-Totals for Drill- Down Tables 3a, 3b, and 4 show Sales Roll Up by Model by Year by Color and an Excel Pivot Table with this information

21 Roll-Ups and Sub-Totals for Drill- Down Excel Pivot Table Sales Summary Roll Up in Table 5a and 5b for Chevy over all color and years (Note the ALL value)

22 SQL Query for Chevy Roll Up

23 Cube: Each Attribute is a Dimension N-dimensional Aggregate (sum(), max(),...)  Fits relational model exactly: a 1, a 2,...., a N, f() Super-aggregate over N-1 Dimensional sub-cubes ALL, a 2,...., a N, f() a 1, ALL, a 3,...., a N, f()... a 1, a 2,...., ALL, f()  This is the N-1 Dimensional cross-tab. Super-aggregate over N-2 Dimensional sub-cubes ALL, ALL, a 3,...., a N, f()... a 1, a 2,...., ALL, ALL, f()

24 Sub-cube Derivation Dimension collapse, * denotes ALL

25 Cube Operator Example CUBE

26 Interesting Aggregate Functions From RedBrick systems  Rank (in sorted order)  N-Tile (histograms)  Running average (cumulative functions)  Windowed running average  Percent of total Users want to define their own aggregate functions  statistics  domain specific

27 August 25, 2015 Data Mining: Concepts and Techniques 27 Conceptual Modeling of Data Warehouses Modeling data warehouses: dimensions & measures  Star schema: A fact table in the middle connected to a set of dimension tables  Snowflake schema: A refinement of star schema where some dimensional hierarchy is normalized into a set of smaller dimension tables, forming a shape similar to snowflake  Fact constellations: Multiple fact tables share dimension tables, viewed as a collection of stars, therefore called galaxy schema or fact constellation

28 August 25, 2015 Data Mining: Concepts and Techniques 28 Example of Star Schema time_key day day_of_the_week month quarter year time location_key street city state_or_province country location Sales Fact Table time_key item_key branch_key location_key units_sold dollars_sold avg_sales Measures item_key item_name brand type supplier_type item branch_key branch_name branch_type branch

29 August 25, 2015 Data Mining: Concepts and Techniques 29 Example of Snowflake Schema time_key day day_of_the_week month quarter year time location_key street city_key location Sales Fact Table time_key item_key branch_key location_key units_sold dollars_sold avg_sales Measures item_key item_name brand type supplier_key item branch_key branch_name branch_type branch supplier_key supplier_type supplier city_key city state_or_province country city

30 August 25, 2015 Data Mining: Concepts and Techniques 30 Example of Fact Constellation time_key day day_of_the_week month quarter year time location_key street city province_or_state country location Sales Fact Table time_key item_key branch_key location_key units_sold dollars_sold avg_sales Measures item_key item_name brand type supplier_type item branch_key branch_name branch_type branch Shipping Fact Table time_key item_key shipper_key from_location to_location dollars_cost units_shipped shipper_key shipper_name location_key shipper_type shipper

31 August 25, 2015 Data Mining: Concepts and Techniques 31 A Concept Hierarchy: Dimension (location) all EuropeNorth_America MexicoCanadaSpainGermany Vancouver M. WindL. Chan... all region office country TorontoFrankfurtcity

32 August 25, 2015 Data Mining: Concepts and Techniques 32 Data Cube Measures: Three Categories Distributive: if the result derived by applying the function to n aggregate values is the same as that derived by applying the function on all the data without partitioning E.g., count(), sum(), min(), max() Algebraic: if it can be computed by an algebraic function with M arguments (where M is a bounded integer), each of which is obtained by applying a distributive aggregate function E.g., avg(), min_N(), standard_deviation() Holistic: if there is no constant bound on the storage size needed to describe a subaggregate. E.g., median(), mode(), rank()

33 August 25, 2015 Data Mining: Concepts and Techniques 33 Typical OLAP Operations over Data Cube Roll up (drill-up): summarize data  by climbing up hierarchy or by dimension reduction Drill down (roll down): reverse of roll-up  from higher level summary to lower level summary or detailed data, or introducing new dimensions Slice and dice: project and select Pivot (rotate):  reorient the cube, visualization, 3D to series of 2D planes Other operations  drill across: involving (across) more than one fact table  drill through: through the bottom level of the cube to its back-end relational tables (using SQL)

34 August 25, 2015 Data Mining: Concepts and Techniques 34 Definition of Cube Operation A new operator cube by, introduced by Gray et al.’96 SELECT item, city, year, SUM (amount) FROM SALES CUBE BY item, city, year Need compute the following Group-Bys (date, product, customer), (date,product),(date, customer), (product, customer), (date), (product), (customer) () (item)(city) () (year) (city, item)(city, year)(item, year) (city, item, year)

35 August 25, 2015 Data Mining: Concepts and Techniques 35 Cube: A Lattice of Cuboids time,item time,item,location time, item, location, supplier all timeitemlocationsupplier time,location time,supplier item,location item,supplier location,supplier time,item,supplier time,location,supplier item,location,supplier 0-D (apex) cuboid 1-D cuboids 2-D cuboids 3-D cuboids 4-D (base) cuboid

36 August 25, 2015 Data Mining: Concepts and Techniques 36 Iceberg Cube Computing only the cuboid cells whose count or other aggregates satisfy a condition with minimum support, e.g. HAVING COUNT(*) >= minsup

37 August 25, 2015 Data Mining: Concepts and Techniques 37 Indexing OLAP Data: Bitmap Index Index on a particular column Each value in the column has a bit vector: bit-op is fast The length of the bit vector: # of records in the base table The i-th bit is set if the i-th row of the base table has the value for the indexed column  A recent bit compression technique, Word-Aligned Hybrid (WAH), makes it work for high cardinality domain as well [Wu, et al. TODS’06] Base table Index on RegionIndex on Type

38 August 25, 2015 Data Mining: Concepts and Techniques 38 Indexing OLAP Data: Join Indices Join index:  JI(R-id, S-id) where R (R-id, …)  S (S-id, …) In data warehouses, join index relates the values of the dimensions of a star schema to rows in the fact table.  E.g. fact table: Sales and two dimensions city and product A join index on city maintains for each distinct city a list of R-IDs of the tuples recording the Sales in the city  Join indices can span multiple dimensions

39 August 25, 2015 Data Mining: Concepts and Techniques 39 Efficient Processing OLAP Queries Determine which operations should be performed on the available cuboids  Transform drill, roll, etc. into corresponding SQL and/or OLAP operations, e.g., dice = selection + projection Determine which materialized cuboid(s) should be selected for OLAP op.  Let the query to be processed be on {brand, province_or_state} with the condition “year = 2004”, and there are 4 materialized cuboids available: 1) {year, item_name, city} 2) {year, brand, country} 3) {year, brand, province_or_state} 4) {item_name, province_or_state} where year = 2004 Which should be selected to process the query? Explore indexing structures and compressed vs. dense array structs in MOLAP

40 August 25, 2015 Data Mining: Concepts and Techniques 40 OLAP Server Architectures Relational OLAP (ROLAP)  Use relational or extended-relational DBMS to store and manage warehouse data and OLAP middle ware  Include optimization of DBMS backend, implementation of aggregation navigation logic, and additional tools and services  Greater scalability Multidimensional OLAP (MOLAP)  Sparse array-based multidimensional storage engine  Fast indexing to pre-computed summarized data Hybrid OLAP (HOLAP) (e.g., Microsoft SQLServer)  Flexibility, e.g., low level: relational, high-level: array

41 Summary Decision support is an emerging, rapidly growing subarea of databases. Involves the creation of large, consolidated data repositories called data warehouses. Warehouses exploited using sophisticated analysis techniques: complex SQL queries and OLAP “multidimensional”queries (influenced by both SQL and spreadsheets). New techniques for database design, indexing, view maintenance, and interactive querying need to be supported.


Download ppt "Data Warehousing and Decision Support courtesy of Jiawei Han, Larry Kerschberg, and etc. for some slides. Jianlin Feng School of Software SUN YAT-SEN UNIVERSITY."

Similar presentations


Ads by Google