html5-img
1 / 69

SQL Server 2008 for Business Intelligence

SQL Server 2008 for Business Intelligence. Last Session. Business Intelligence Data Warehouse Measure (Facts) Dimension ETL SSIS. Cubes. Session 2: Cubes. What is a Cube? Steps in Creating a Cube Demo: Creating a Cube Cube Issues Hands on Lab. Cubes. Cube.

bambi
Download Presentation

SQL Server 2008 for Business Intelligence

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SQL Server 2008 for Business Intelligence

  2. Last Session • Business Intelligence • Data Warehouse • Measure (Facts) • Dimension • ETL • SSIS

  3. Cubes

  4. Session 2: Cubes • What is a Cube? • Steps in Creating a Cube • Demo: Creating a Cube • Cube Issues • Hands on Lab

  5. Cubes

  6. Cube • Data structure for fast analysis of data • Precalculated • On top of a data warehouse • Manipulating and analysing data • from multiple perspectives

  7. Why a cube? • Performance • Relational databases not suited for instantaneous analysis • Cube precalculates (aggregates) data

  8. Cube Concept Groceries Electronics Product Clothing North South Garden East Geog Automotive West Q1 Q2 Q3 Q4 Time

  9. Edges are Dimensions North South East West

  10. Groceries North Q4

  11. “Import“ cube example • Sum over Packages • Max over Last

  12. Aggregate measures over time dimension • Attribute hierarchy

  13. Aggregate measures by multi dimensions

  14. Why a cube? • Performance • Relational databases not suited for instantaneous analysis • Cube precalculates (aggregates) data • KPI and trending

  15. Adventure Works example • A cube is an • “aggregation of measures against dimensions”

  16. What is a Cube - Example

  17. What is a Cube - Example

  18. What is a Cube in SQL 2005/2008 • Data Source • Where the data comes from • Adventure works connection string • Data Source View • The tables and how they link together • Orders, Details, Products and relationships • Name matching to detect relationships • Dimensions • How we break up the aggregate data • Products, Time • Measures (Facts) • The aggregate data • Line Total, Quantity

  19. Steps in Creating a Cube • Define Data Source • Create Data Source View • Define Dimensions • Define Measures (Facts) • Process the Cube

  20. Data Source - Database

  21. Data Source - Impersonation (Authentication)

  22. Data Source View – Data Source

  23. Data Source View – Connect Tables (Name Matching)

  24. Data Source View – Select Tables and Views

  25. Data Source View • Manually adjust relationships missed by the wizard

  26. Build a Cube – Build Method

  27. Build a Cube – Select a Data Source View

  28. Build a Cube – Select Measures

  29. Build a Cube – Select Dimension

  30. Build a Cube - Select Time Periods

  31. Build a Cube – Process Cube

  32. Build a Cube – Process Cube

  33. Build a Cube • Review Auto Generated Cube • Check Hierarchies e.g. Product Category shows ID rather than name

  34. Build a Cube – Fix Dimensions

  35. Cube Issues • Keeping things Related • Dimensions should tie in to Fact tables • Use Primary Keys • Keeping things Relevant • Multiple fact tables • Even more dimensions • Keeping things Fresh • Needs to be processed • Automated SSIS Packages • Keeping Missing Data • Fails to process when keys are missing • Change missing keys to Unknown

  36. MOLAP vs ROLAP • Multidimensional Online Analytical Processing • Relational Online Analytical Processing

  37. MOLAP ROLAP • Fast query performance • Consumes less disk space • Auto aggregation of data • Processing can be slow • Works well with large volumes of data • Real time • Securable • Slower than MOLAP • Need to create your own aggregations • Not suited for budgeting and forecasting

  38. Best Practices - Dimensions • Consolidate multiple hierarchies into a single dimension • Avoid ROLAP storage model • Use role playing dimensions (e.g. OrderDate, BillDate, ShipDate) – avoids multiple physical copies • Set Materialized = true on reference dimensions • Avoid Many-to-Many dimensions (slow)

  39. Best Practices – Attributes/Hierachies • Define all possible attribute relationships • Remove redundant attribute relationships • Mark attribute relationships as rigid where appropriate • Use integer (or numeric) key columns • Set AttributeHierarchyEnabled = false for attributes not used for navigation (e.g. Phone #, Address Line 1) • Set AttributeHierarchyOptimizedState to NotOptimized for infrequently used attributes • Set AttributeHierarchyOrdered to false if the order of members returned by queries is not important

  40. Best Practices - Measures • Use smallest numeric data type possible • Use semi-additive aggregate functions instead of MDX calculations to achieve same behaviour • Put distinct count measures into separate measure group (BIDS does this automatically) • Avoid string source column for distinct count measures

  41. Best Practices - OLAP • No more than 20M rows per partition • Manage storage settings by usage patterns • Frequently queried => MOLAP with lots of aggregations • Periodically queries => MOLAP with less or no aggregations • Historical => ROLAP with no aggregations • Use multiple disk controllers for IO performance

  42. Best Practices - General • Create Perspectives to help with querying data • Create Measure Groups • Create Calculated Measures and KPIs for frequently analysed data – if you can do it in the DSV that’s preferable

  43. MDX • MultiDimensionalEXpressions

  44. Syntax SELECT { <Measure>,…} ON COLUMNS, { <Dimension> } ON ROWS FROM <Cube> WHERE (<Filters>)

  45. Our data SELECT FROM [Adventure Works] WHERE [Measures].[Internet Order Count]

  46. Internet Orders

  47. Slicing our data – 2007 Q1 SELECTFROM[Adventure Works]WHERE ( [Measures].[Internet Order Count], [Date].[Fiscal].[Fiscal Quarter].&[2007]&[1])

  48. Internet Orders in 2007 Q1 2007 Q1

  49. Slicing our data – 2007 Q1, Australia SELECTFROM[Adventure Works]WHERE ( [Measures].[Internet Order Count], [Date].[Fiscal].[Fiscal Quarter].&[2007]&[1],[Customer].[Customer Geography].[Country].&[Australia])

  50. Internet Orders in 2007 Q1, Australia Australia 2007 Q1

More Related