Вы находитесь на странице: 1из 27

SAP HANA 1.

0
Modeling fundamentals

2011 SAP AG. All rights reserved. 1


Agenda

Modeling Fundamentals & Best Practices


Analytical View & Calculation View Fundamentals
Design time vs. Runtime objects
General Modeling Principles
Modeling new functionality

2011 SAP AG. All rights reserved. 2


SAP HANA Modeling Fundementals

Attribute Views (Dimensions, Time, Hierarchy, Derived)


Analytical Views (Facts/Star Schemas)
Modeling

Calculation Views (Composite views, Modeled or Script)


Views
Transportable design time artifacts stored in the repository
Database objects (Column store views) are generated from these
development artifacts

Main procedural language of the SAP HANA database


Langauge

Push data intensive operations into the database


SQL Utilized in Calculation Views and Procedures
Script Read-Only procedures (Calculation views, highly optimized,
potential of parallelism)
Read-Write procedures (cursors, loops, conditions, transactions)

2011 SAP AG. All rights reserved. 3


SAP HANA Modeling Best Practices

Calculation View

Analytical View Attribute View Column Table

2011 SAP AG. All rights reserved. 4


Agenda

Modeling Fundamentals & Best Practices


Analytical View & Calculation View Fundamentals
Design time vs. Runtime objects
General Modeling Principles
Modeling new functionality

2011 SAP AG. All rights reserved. 5


SAP HANA Analytical View

Attribute View
Dimension
Star schema consist of one fact table
containing the key figures
Dimensions describe the key figures
and enrich the data
Slicing and dicing is a feature whereby
users can take out (slicing) a specific Analytical View
set of data and view (dicing) the slices 1
Fact Table
from different viewpoints
Cardinality in star schemas is generally N N Left Outer

N:1 fact to dimension


1
Joins in star schemas are generally Left 1

Outer Joins
Analytical models are highly optimized
for aggregating mass data

2011 SAP AG. All rights reserved. 6


SAP HANA Calculation View

Several options available


Modeling using the Graphical Modeler
Write SQL Script and use CE Functions Graphical
Write SQL Script and using SQL
Suggested option = Graphical Modeler
No SQL or SQL Script knowledge required
Built-in Union Constant support
Graphical & SQL Script + CE Functions
Result in similar performance gains (e.g.
Field pruning, Parallelization, join
ommision)
Standard SQL SQL
Does not provide field pruning and can be
less optimized. Useful for POCs and rapid
prototyping
CE Functions

2011 SAP AG. All rights reserved. 7


Agenda

Modeling Fundamentals & Best Practices


Analytical View & Calculation View Fundamentals
Design time vs. Runtime objects
General Modeling Principles
Modeling new functionality

2011 SAP AG. All rights reserved. 8


SAP HANA Design Time vs. Runtime Time Objects

Activation of models creates an


executable, optimized Column Design time Model
(database) view of the model
Front ends queries column views and Activate
as a result a specific execution plan is
instantiated based on fields requested
Un-used fields are pruned; un-used
tables joins are omitted; filters are
pushed down Column View
Attributes are retrieved and Measures
are calculated in parallel

SELECT PERIO, VKORG, SUM(CM1)

2011 SAP AG. All rights reserved. 9


SAP AG 2011
Agenda

Modeling Fundamentals & Best Practices


Analytical View & Calculation View Fundamentals
Design time vs. Runtime objects
General Modeling Principles
Modeling new functionality

2011 SAP AG. All rights reserved. 10


SAP HANA General Modeling Principles
Avoid transfer data of large resultsets between the HANA
DB and client application
Client / Application
- Do calculation after aggregation.
A G Y Z

- Avoid Complex expressions (IF, CASE, ... )

Calculation Views Reduce data transfer between views

A G Y Aggregate data records (e.g using


GROUP BY, reducing Coulmns)

Attribute Analytical Join on Key Columns or Indexed


A B C D G Y
Columns
Views Views
Avoid calculations before
aggregation on line item level

A B C D

Column
Filter data amount as early as
possible in the lower layers
Store (CONSTRAINTS, WHERE Clause,
Analytical Privileges..)

2011 SAP AG. All rights reserved. 11


SAP HANA Basic Modeling Principle (Aggregate, filter, pushdown)

SPART PLANT A PLANT B PLANT C TOTAL

ABC 60 60 0 120

SELECT
SPART
SUM(KWMENGA)
SUM(KWMENGB)
SUM(KWMENGC)
SPART MATNR KWMENGA KWMENGB KWMENGC
SUM(TOTAL)
ABC DPC1017 60 0 0 FROM CALCVIEW
ABC DOC1017 0 60 0 WHERE MATNR =
DPC1017
GROUP BY SPART

FILTERS pushed
down
SELECT SPART, MATNR, WERKS,
SUM(KWMENG) FROM VIEW WHERE
WERKS = ? AND MATNR = ?

OLAP A OLAP A OLAP A

SPART MATNR WERKS KWMENG SPART MATNR WERKS KWMENG SPART MATNR WERKS KWMENG

ABC DPC1017 100 60 ABC DPC1017 1000 60 - - - -

2011 SAP AG. All rights reserved. 12


Agenda

Modeling Fundamentals & Best Practices


Analytical View & Calculation View Fundamentals
Design time vs. Runtime objects
General Modeling Principles
Modeling new functionality

2011 SAP AG. All rights reserved. 13


SAP HANA Variables & input parameters

Variables and Parameters are usually entered Use Variable as a Prompt


manually by the user using UI Prompts
Variables are bound to attributes and used to filter
using WHERE clauses (Single, Interval, Range)
Input Parameters are passed by Placeholders and
used in Formulas (Attribute, Currency, Date,
Static List)
It is the task of the client to convert the user input
into either WHERE clause or Placeholders when
accessing the data

Devine Variable

2011 SAP AG. All rights reserved. 14


SAP HANA - Aggregation Node

A new Aggregated Columns folder is visible in the output of a Graphical Calculation View
The definition of the specific aggregation type is maintained in the property view
Only columns of numerical & date data types are allowed (like for measures)
The calculation and filtering occurs after the aggregation

Aggregation

2011 SAP AG. All rights reserved. 15


SAP HANA - Exceptional Aggregation

A new Counters folder is visible in the output view of a Graphical Calculation view
Ability to define Count Distinct functions based on specific Dimensions (1..N)

Count

2011 SAP AG. All rights reserved. 16


SAP HANA - Optional Measures

Within Calculation views measures can now be made optional


The output node instead will be a projection node
Models should be simple SQL views that do not automatically aggregate the measures
The output node does not offer any measures
(or hierarches) but just attributes
The Calculation view is not consumable via
MDX (Explorer / AAO)
The Calculation view is only consumable via
SQL
To disable measures set the Multidimensional
Reporting flag accordingly within the
properties view

Multidimensional
Reporting Flag

2011 SAP AG. All rights reserved. 17


SAP HANA - Join Suggestions

The goal is to simplify modeling by proposing tables and suggesting joins


This features is available in both Attribute and Analytical Views
Prerequisite: table DD08L needs to exist in HANA
Select Propose Tables, then choose the required tables
Highlight all the tables and select Suggest Joins

Suggest Joins

Propose Tables

2011 SAP AG. All rights reserved. 18


SAP HANA - Analytical Privileges

In addition to equal and between SP4 provides GE (greater equal), LE (less equal) and
CP (contains pattern), GT (Greater Than) and LT (Less Than)

2011 SAP AG. All rights reserved. 19


SAP HANA - Intellisense

Intellisence assistance provided in SQL editor and function editors


Provides both the function Syntax details and code Examples

2011 SAP AG. All rights reserved. 20


SAP HANA - Multi User Support

The same object will not exist in the inactive workspace of several users
Only one inactive version of any object is allowed
In addition there is now functionality to discard an inactive version and to return it to the
active status
System Privileges - REPO.WORK_IN_FOREIGN_WORKSPACE required

2011 SAP AG. All rights reserved. 21


SAP HANA - Union

Constant Union enhancement


Allow to add unmapped columns that
only have a constant mapping
Additionally it is required to specify a
data type
Example. The Planned vs. Actual
indicator can now be set in the Union
instead of defining the flag within a
Projection node

Constant Union
Manage Mapping

2011 SAP AG. All rights reserved. 22


SAP HANA Intermediate Data Preview

Calculation View enhancement


Allows easier design and prototyping
Requires that the View has been
activated
Example: Data Preview before and
after filtering a Join

2011 SAP AG. All rights reserved. 23


SAP HANA Decision Tables

SQLScript Enhancement
Graphical user interface to simplify
changing data
Supports Tables and Analytical Views
Example: Updating prices based on
attribute and measure conditions

2011 SAP AG. All rights reserved. 24


SAP HANA Attribute views

Table Aliases

Add the same table to an Attribute View multiple times with the assignment of an alias.
Upon selecting a table twice the system will prompt for an alias.

Hide attributes

Functionality to hide attributes has


been extended to attribute views
from within the context of an
analytic view.

2011 SAP AG. All rights reserved. 25


SAP HANA - Auto Documentation

Generate the metadata documentation for information models and packages created on
SAP HANA systems

2011 SAP AG. All rights reserved. 26


2011 SAP AG. All rights reserved.

No part of this publication may be reproduced or transmitted in any form or for any SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP BusinessObjects
purpose without the express permission of SAP AG. The information contained Explorer, StreamWork, and other SAP products and services mentioned herein as
herein may be changed without prior notice. well as their respective logos are trademarks or registered trademarks of SAP AG
in Germany and other countries.
Some software products marketed by SAP AG and its distributors contain
proprietary software components of other software vendors. Business Objects and the Business Objects logo, BusinessObjects, Crystal
Microsoft, Windows, Excel, Outlook, and PowerPoint are registered trademarks of Reports, Crystal Decisions, Web Intelligence, Xcelsius, and other Business
Microsoft Corporation. Objects products and services mentioned herein as well as their respective logos
are trademarks or registered trademarks of Business Objects Software Ltd.
IBM, DB2, DB2 Universal Database, System i, System i5, System p, System p5, Business Objects is an
System x, System z, System z10, System z9, z10, z9, iSeries, pSeries, xSeries, SAP company.
zSeries, eServer, z/VM, z/OS, i5/OS, S/390, OS/390, OS/400, AS/400, S/390
Parallel Enterprise Server, PowerVM, Power Architecture, POWER6+, POWER6, Sybase and Adaptive Server, iAnywhere, Sybase 365, SQL Anywhere, and other
POWER5+, POWER5, POWER, OpenPower, PowerPC, BatchPipes, Sybase products and services mentioned herein as well as their respective logos
BladeCenter, System Storage, GPFS, HACMP, RETAIN, DB2 Connect, RACF, are trademarks or registered trademarks of Sybase, Inc. Sybase is an SAP
Redbooks, OS/2, Parallel Sysplex, MVS/ESA, AIX, Intelligent Miner, WebSphere, company.
Netfinity, Tivoli and Informix are trademarks or registered trademarks of IBM
All other product and service names mentioned are the trademarks of their
Corporation.
respective companies. Data contained in this document serves informational
Linux is the registered trademark of Linus Torvalds in the U.S. and other purposes only. National product specifications may vary.
countries.
The information in this document is proprietary to SAP. No part of this document
Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or may be reproduced, copied, or transmitted in any form or for any purpose without
registered trademarks of Adobe Systems Incorporated in the United States and/or the express prior written permission of SAP AG.
other countries.
Oracle and Java are registered trademarks of Oracle and/or its affiliates.
UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.
Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and
MultiWin are trademarks or registered trademarks of Citrix Systems, Inc.
HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C,
World Wide Web Consortium, Massachusetts Institute of Technology.

2011 SAP AG. All rights reserved. 27

Вам также может понравиться