23
www.dageop.com Data Modeling ® DM-01 Storing Summarised data DR. SUBRAMANI PARAMASIVAM (MANI)

Data Modeling - Series 1 Storing summarised data

Embed Size (px)

Citation preview

Page 1: Data Modeling - Series 1 Storing summarised data

www.dageop.com

Data Modeling

®

DM-01 Storing Summarised data

DR. SUBRAMANI PARAMASIVAM (MANI)

Page 2: Data Modeling - Series 1 Storing summarised data

About me

Dr. SubraMANI ParamasivamPhD., MCT, MCSE, MCITP, MCP, MCTS, MCSACEO, Principal Consultant & Trainer @ DAGEOP (UK) Email: [email protected] Blog: http://dataap.org/blog

Follow Us

https://www.facebook.com/pages/YOUR-SQL-MAN-LTD/http://www.youtube.com/user/YourSQLMAN

https://twitter.com/dageop

https://uk.linkedin.com/in/dageop

Proud Sponsor

• SQLBits• SQL Saturdays• MCT Summit• SQL Server Geeks

Summit• Data Awareness

Programme• Dageop’s Data Day

®

www.DataAP.org

SPEAKER

Page 3: Data Modeling - Series 1 Storing summarised data

Contents• DM-01 Storing Summarised data• Roll-up Tables• Materialising aggregated data with indexed views

www.dageop.comData Modeling

Page 4: Data Modeling - Series 1 Storing summarised data

Introduction to Data Modeling

www.dageop.comData Modeling

Page 5: Data Modeling - Series 1 Storing summarised data

Introduction to Data Modeling• Data Modeling is a formalization and

documentation of existing process. • Data Modeling techniques converts

complex designs to easily understandable.• Data Modeling can be thought of as

a diagram or flow chart that illustrates the relationship between data• Undergoes Normalization /

Denormalization process.

www.dageop.comData Modeling

Page 6: Data Modeling - Series 1 Storing summarised data

Introduction to Data Modeling• Types Of Data Modeling• Conceptual Data Modeling (CDM) :

Identifies the highest level of relation ship between different entities• Enterprise Data Modeling (EDM) :

Similar to conceptual data Modeling but address the unique requirements of specific business• Logical Data Modeling (LDM) :

Illustrates the specific entities, Attributes and relations involved in a business function • Physical Data Modeling : much required for dB professionals

Represents an application and database specific implementation of LDM

www.dageop.comData Modeling

Page 7: Data Modeling - Series 1 Storing summarised data

Physical Data Model

• Is a representation of a data design.• Includes the facilities and

constraints of a database management system

www.dageop.comData Modeling

Page 8: Data Modeling - Series 1 Storing summarised data

Physical Data Model• The process of building the physical data model from Conceptual data model.• First Step : Conceptual data Model• Second Step : Logical Model• Final : Physical Data Model

www.dageop.comData Modeling

Page 9: Data Modeling - Series 1 Storing summarised data

Physical Data Model• A complete physical data model will include• Physical storage

• Tables, Views, Data types• Referential Integrity

• Primary Keys, Foreign keys, Constraints, Referential Integrity• Programming

• Stored procedure, UDF, Triggers, CLR Function• Indexes• Partitioned tables

www.dageop.comData Modeling

Page 10: Data Modeling - Series 1 Storing summarised data

DM-01 Storing Summarised data

www.dageop.comData Modeling

Page 11: Data Modeling - Series 1 Storing summarised data

Storing Summarised data• Every organization deal with many databases and

millions / billions of records.• Who?• When?• What purpose?• Database size

• SMALL• MEDIUM• LARGE

• Business requirements?• SIMPLE• COMPLEX

www.dageop.comData Modeling

Page 12: Data Modeling - Series 1 Storing summarised data

Storing Summarised data• Performance• DBA • Developers • Management

• Performance matters in any environment.• Summarising the data or just reporting data .

www.dageop.comData Modeling

Page 13: Data Modeling - Series 1 Storing summarised data

Storing Summarised data• Summary reports from aggregated transaction data is used for Management

Information reports.• It could be Complex & resource intensive too. • To overcome this issue, the best tools to be used for multi dimensional

analysis would be• SSIS - Integration Services• SSAS – Analysis Services

• For simple summary reports @ T-SQL level (Used with GROUP BY)• CUBE – Generates multi dimensional cube for the query• ROLLUP – Generates Sub-totals & Totals• COMPUTE & COMPUTE BY – Detail & Summary rows with one SELECT statement.

www.dageop.comData Modeling

Page 14: Data Modeling - Series 1 Storing summarised data

Roll-up Tables

www.dageop.comData Modeling

Page 15: Data Modeling - Series 1 Storing summarised data

Roll-up Tables• Rollup is used to calculate multiple levels of subtotals across specified

group of dimensions.

• Subtotal and Grand total in a single query when the table is populated.

• Used with GROUP BY clause

• Highly efficient and helps fast retrieval.www.dageop.com

Data Modeling

Page 16: Data Modeling - Series 1 Storing summarised data

Roll-up Tables

SELECT <Column_Names>FROM <Table_Name>GROUP BY <Column_Names> WITH ROLLUP

www.dageop.comData Modeling

Page 17: Data Modeling - Series 1 Storing summarised data

DEMO

www.dageop.comData Modeling

Page 18: Data Modeling - Series 1 Storing summarised data

Materialising aggregated data with indexed views

www.dageop.comData Modeling

Page 19: Data Modeling - Series 1 Storing summarised data

Materialising aggregated data with indexed views

• What is a View?• What is an Index?• What is an Indexed View?

CLUSTERED & NON-CLUSTERED indexes can be created on a view.

10K

www.dageop.comData Modeling

Table

View

Logical Physical Records

INDEX

IX View

1M

10K

Page 20: Data Modeling - Series 1 Storing summarised data

DEMO

www.dageop.comData Modeling

Page 21: Data Modeling - Series 1 Storing summarised data

www.dageop.comData Modeling

ReviewStoring Summarised data

Roll-up TablesMaterialising aggregated data with indexed views

Page 22: Data Modeling - Series 1 Storing summarised data

Q & A

www.dageop.comData Modeling

Page 23: Data Modeling - Series 1 Storing summarised data

®

www.dageop.com