Aggregate Awareness

Embed Size (px)

DESCRIPTION

Aggregate Awareness

Text of Aggregate Awareness

The Aggregate Awareness DecisionBob CohenSense CorpOctober 2001

Presentation Overview

Introduction Overview of aggregate awareness Aggregate awareness in Business Objects RDBMS materialized views for aggregate awareness Examples of each architecture Architectural trade offs Q&A

Copyright 2001 Business Objects - All Rights Reserved 3

Introduction

About Bob Cohen Who is the target audience Contact Info

Sense Corp 17 Ramsgate Drive St Louis, MO 63132 bcohen@sensecorp.com

Copyright 2001 Business Objects - All Rights Reserved 4

What is Aggregate Awareness?

It is the ability to dynamically re-write SQL to the level of granularity needed to answer a business question Allows for faster querying speedDocument_Id Line_Item Customer_Id Dollars

Customer_Id Dollars

1,000,000 Rows5

1,000 Rows

Copyright 2001 Business Objects - All Rights Reserved

Setting up Business Objects Aggregate Awareness

Create all tables, joins, and objects at the universe level

Specify all aggregate awareness objects

Define contexts

Specify join pathsUse aggregate navigation functionality

Specify incompatible objects

All aggregated facts physically created during extraction, transformation, and load (ETL)

Copyright 2001 Business Objects - All Rights Reserved 6

Business Objects Aggregate Awareness Example

Copyright 2001 Business Objects - All Rights Reserved 7

Materialized Views Overview

Increase the query speed of very large data sets Physically stores aggregated and joined data sets at the database level Can create both simple and complex views Different from traditional database views

Copyright 2001 Business Objects - All Rights Reserved 8

Materialized View Vendor Availability

Oracle Sybase Informix

Copyright 2001 Business Objects - All Rights Reserved 9

Simple vs. Complex Materialized Views

Simple views

Selects rows from only one table Cannot perform any joins, group by functions, or connect by functions Complete refresh of data required

Complex views

Copyright 2001 Business Objects - All Rights Reserved 10

Materialized Views Alter Execution Path RDBMSOriginal Query

SQL

Optimizer Picks Best Cost OptionQuery is rewritten

Query Result

Copyright 2001 Business Objects - All Rights Reserved 11

Setting up Materialized Views

Query re-write needs to be enabled at the database or session level Following permissions need to be set up for each user that can create a materialized view

Create materialized view Create table Create view Create index Unlimited or sufficient space

Each materialized view uses as much space as a physical tableCopyright 2001 Business Objects - All Rights Reserved 12

Setting up Materialized Views

To use the alter query execution path functionality, you must set up a dimension

The dimension sets a hierarchy for each related dimension

Each materialized view needs to be coded with a create statement on the database Analyze statistics in order for optimizer to recognize materialized views Can create an index on materialized view

Copyright 2001 Business Objects - All Rights Reserved 13

Materialized View Example

Copyright 2001 Business Objects - All Rights Reserved 14

Architectural Trade-OffsBusiness Objects Code Location Metadata Objects created at the universe level Allows for centralized metadata repository Tables physically created through ETL process RDBMS

1-3

Manually coded at database level Metadata hidden in complex code

ETL

Materialized views created through code

Copyright 2001 Business Objects - All Rights Reserved 15

Architectural Trade-OffsBusiness Objects Source Specific Can be used against any source RDBMS

2-3

RDBMS must support materialized views; if multiple sources, need to be maintained in each database

Re-Write Location

All code re-written before submitted to RDBMS

Re-written in RDBMS

Copyright 2001 Business Objects - All Rights Reserved 16

Architectural Trade-OffsBusiness Objects RDBMS

3-3

Owner of the Code

Universe Designer or DBA DW architectYes No

Visible SQL

Universe Design Complexity

Yes

No

Copyright 2001 Business Objects - All Rights Reserved 17

Design Option 1Do Not Implement any Aggregate Awareness

Keeps design simple Speed is not always a requirement Not all reporting requires aggregation Users know data well enough to know which tables to query

Copyright 2001 Business Objects - All Rights Reserved 18

Design Option 2Implement Aggregate Awareness through BusinessObjects Exclusively

Ideal for architecture with many database sources

Not every database source supports materialized views Materialized views need to be maintained in every database source

Copyright 2001 Business Objects - All Rights Reserved 19

Design Option 2SQL Server

BO Repository

Oracle 8i

MS Access

Copyright 2001 Business Objects - All Rights Reserved 20

Design Option 2Implement Aggregate Awareness through BusinessObjects Exclusively

Need for centralized metadata repository Do not have access to a strong DBA Closed reporting architecture

Takes advantage of strong semantic layer in BusinessObjects

Copyright 2001 Business Objects - All Rights Reserved 21

Design Option 3Implement Materialized Views in RDBMS

Implement materialized views in RDBMS

Ideal for architectures with many reporting tools

Copyright 2001 Business Objects - All Rights Reserved 22

Design Option 3BO

Custom Report Application

Data Warehouse

MS Access

Copyright 2001 Business Objects - All Rights Reserved 23

Design Option 3Implement Materialized Views in RDBMS

Need quick results Access to strong DBA Simplify universe design Have one or few sources Do not need a centralized metadata repository

Copyright 2001 Business Objects - All Rights Reserved 24

Design Option 4Implement Both Materialized Views in RBDMS and Aggregate Awareness in BusinessObjects

Willing to deal with complexity Recognizes advantages in both approaches Able to define advantages for each architecture

Use materialized views for refreshing list of values

Copyright 2001 Business Objects - All Rights Reserved 25

Design Option 4

Copyright 2001 Business Objects - All Rights Reserved 26

Q&A

Which approach is best for you

Copyright 2001 Business Objects - All Rights Reserved 27