This document discusses techniques for storing summarized data efficiently. It introduces roll-up tables, which use the GROUP BY clause to calculate subtotals and grand totals in a single query. Indexed views are also covered, which allow indexes to be created on views to materialize aggregated data and improve performance. The document promotes the use of SQL Server tools like SSIS, SSAS, rollups and compute functions to generate summaries over complex, multi-dimensional analysis.
5. 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.com
Data Modeling
6. 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.com
Data Modeling
7. Physical Data Model
• Is a representation of a data
design.
• Includes the facilities and
constraints of a database
management system
www.dageop.com
Data Modeling
8. 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.com
Data Modeling
9. 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.com
Data Modeling
11. 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.com
Data Modeling
12. Storing Summarised data
• Performance
• DBA
• Developers
• Management
• Performance matters in any environment.
• Summarising the data or just reporting data .
www.dageop.com
Data Modeling
13. 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.com
Data Modeling
15. 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
19. 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.com
Data Modeling
Table
View
Logical Physical Records
INDEX
IX
View
1M
10K