Pertemuan VIII Dimensional Modelling
Relational Database Model FMMFFMMF Anderson Green Lee Ramos Attribute 1 Name Attribute 2 Age Attribute 3 Gender Row 1 Row 2 Row 3 Row 4 The table above illustrates the employee relation.
Multidimensional Database Model The data is found at the intersection of dimensions. Store GL_Line Time FINANCE Store Product Time SALES Customer
Two dimensions
Three dimensions
MOLAP (multidimensional online analytical processing) Server The application layer stores data in a multidimensional structure The presentation layer provides the multidimensional view MOLAP Engine DSS client Application layer Warehouse Efficient storage and processing Complexity hidden from the user Analysis using preaggregated summaries and precalculated measures
ROLAP (relational online analytical processing) Server The warehouse stores atomic data. The application layer generates SQL for the three- dimensional view. The presentation layer provides the multidimensional view. ROLAP engine DSS client Application layer Warehouse server Multipl e SQL
MOLAP ExpressServerExpressuserWarehouse Query Data MDDB Periodicload
ROLAP ExpressServer Expressuser Warehouse Datacache Livefetch Cache Query Data Also Hybrid (HOLAP)
Identifying Business Rules Product Type Monitor Status PC15 inchNew Server17 inchRebuilt 19 inch Custom None Location Geographic proximity miles miles > 5 miles Store Store > District > Region Time Month > Quarter > Year
Creating the Dimensional Model Identify fact tables –Translate business measures into fact tables –Analyze source system information for additional measures –Identify base and derived measures –Document additivity of measures Identify dimension tables Link fact tables to the dimension tables Create views for users
Summary Tables Example SALES FACTS SalesRegionMonth 10,000NorthJan 99 12,000SouthFeb 99 11,000North Jan 99 15,000WestMar 99 18,000South Feb 99 20,000North Jan 99 10,000EastJan 99 2,000WestMar 99 SALES BY MONTH/REGION MonthRegionTot_Sales$ Jan 99North41,000 Jan 99East10,000 Feb 99South40,000 Mar 99West17,000 SALES BY MONTH MonthTot_Sales Jan 9951,000 Feb 9940,000 Mar 9917,000
Kubus OLAP bekerja dengan data dalam bentuk multidimensi. Yang umum, bentuk tiga dimensi diwujudkan ke dalam bentuk kubus data.
14 Cube Fact table view: Multi-dimensional cube: dimensions = 2
15 3-D Cube day 2 day 1 dimensions = 3 Multi-dimensional cube:Fact table view:
16 Aggregates Add up amounts for day 1 In SQL: SELECT sum(amt) FROM SALE WHERE date = 1 81
17 Aggregates Add up amounts by day In SQL: SELECT date, sum(amt) FROM SALE GROUP BY date
18 Another Example Add up amounts by day, product In SQL: SELECT date, sum(amt) FROM SALE GROUP BY date, prodId drill-down rollup
19 Aggregates Operators: sum, count, max, min, median, ave Using dimension hierarchy –average by region (within store) –maximum by month (within date)
Suatu Konsep Hierarki: Dimensi (location) all EuropeNorth_America MexicoCanadaSpainGermany Vancouver M. WindL. Chan... all region office country TorontoFrankfurt city
Data Multidimensi Volume Sales sebagai suatu fungsi dari product, month, dan region Product Region Month Dimensi: Product, Location, Time Path intisari hierarkikal Industry Region Year Category Country Quarter Product City Month Week Office Day
Contoh Kubus Data Total penjualan TV Setahun di U.S.A. Date Product Country sum TV VCR PC 1Qtr 2Qtr 3Qtr 4Qtr U.S.A Canada Mexico sum
Bentuk Kubus Yang Terkait Dengan Kubus Data all product date country product,date product,countrydate, country product, date, country 0-D(apex) cuboid 1-D cuboids 2-D cuboids 3-D(base) cuboid
Model Kubus Data Melihat data sebagai kubus
Operasi Kubus Data OLAP Roll up (drill-up): merujuk ke peningkatan hierarki atau pengurangan dimensi (diberikan total sales by “city”, di roll-up untuk mendapatkan total sales by “state”) Drill down (roll down, kebalikan roll-up): merujuk ke penurunan hierarki atau penambahan dimensi (diberikan total sales by “state”, di roll-down untuk mendapatkan total sales by “city”)
Operasi Kubus Data OLAP
Slice: merujuk ke pemilihan dimensi yang digunakan untuk melihat kubus (“customer” by “product” by “date”) Dice: merujuk ke pemilihan posisi sesungguhnya sepanjang dimensi Pivot (rotasi): reorientasi kubus, visualisasi, 3D ke sebarisan bidang 2D
Operasi Kubus Data OLAP
Contoh Kubus Data