the art science of tuning hana models for performance ifg...

41
Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts & Science of Tuning HANA models for Performance

Upload: hakhuong

Post on 06-Feb-2018

224 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

Abani Pattanayak, SAP HANA CoENov 12, 2015

The Arts & Science of Tuning HANA modelsfor Performance

Page 2: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 2Public

Disclaimer

This presentation outlines our general product direction and should not be relied on in making apurchase decision. This presentation is not subject to your license agreement or any otheragreement with SAP. SAP has no obligation to pursue any course of business outlined in thispresentation or to develop or release any functionality mentioned in this presentation. Thispresentation and SAP's strategy and possible future developments are subject to change and maybe changed by SAP at any time for any reason without notice. This document is provided without awarranty of any kind, either express or implied, including but not limited to, the implied warranties ofmerchantability, fitness for a particular purpose, or non-infringement. SAP assumes no responsibilityfor errors or omissions in this document, except if such damages were caused by SAP intentionallyor grossly negligent.

Page 3: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 3Public

SAP HANA: The Platform for All Applications

SAP HANA PLATFORMON-PREMISE | CL OUD | HYBRID

Web Server JavaScript

Fiori UX Graphic Modeler

Data Virtualization ELT & Replication

Application Services Integration & Quality Services

Columnar OLTP+OLAP

Multi-Core &Parallelization

Advanced Compression

Multi-tenancy

Multi-Tier Storage

Spatial Graph Predictive Search

Text Analytics

DataQuality

SeriesData

Business Functions

ALM

Processing Services

Database Services

Hadoop & Spark Integration

Streaming Analytics

Application Lifecycle Management

High Availability & Disaster Recovery

OpennessData Modeling

Remote DataSync

Admin & Security

Page 4: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

Overview

Page 5: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 5Public

What’s Model Performance?

• SQL Query

• Query Run Time

• Memory Usage

• CPU Usage

• Concurrency

Page 6: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 6Public

• Dynamic memory (at least 50%)

• Enough CPU (1+ core/8GB)

• Single node vs. Scale-out

• Single/Multi-Tenant (Shared)

• Cloud vs. In-premise

What’s under the hood i.e. Horse Power?

Page 7: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 7Public

• Analysis of SQL query

• Visual walkthrough of model

• Explain plan (engine used)

• Visualize plan

• HDBAdmin

SAP HANA: Performance Tools

Page 8: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 8Public

• SELECT EMPLOYEE FROM "_SYS_BIC"."abani/CV_SALES";

• SELECT EMPLOYEE, SUM(SALES) FROM

(SELECT * FROM "_SYS_BIC"."abani/CV_SALES")GROUP BY EMPLOYEE;

• SELECT Table_1.EMPLOYEE, SUM(Table_1.SALES) FROM "_SYS_BIC"."abani/CV_SALES" as Table_1 INNER JOIN

"_SYS_BIC"."abani/AT_DATE" as Table_2ON Table_1.DATE_SQL = Table_2.DATE_SQL

WHERE Table_2.DATE = TO_CHAR('20150101','YYYY-MM-DD');

Analysis of SQL query

Page 9: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 9Public

• SELECT TOP 50 DISTINCT EMPLOYEE FROM"_SYS_BIC"."abani/CV_SALES";

• SELECT EMPLOYEE, SUM(SALES) FROM

(SELECT * FROM "_SYS_BIC"."abani/CV_SALES")

GROUP BY EMPLOYEE;

• SELECT Table_1.EMPLOYEE, SUM(Table_1.SALES) FROM

"_SYS_BIC"."abani/CV_SALES_FINAL" as Table_1WHERE Table_1.DATE_NEW = '20150101'

GROUP BY Table_1.EMPLOYEE;

Analysis of SQL query

Page 10: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 10Public

• View properties• Review the joins• Calculated columns• Scripted views• Cardinality of dataset• …

Visual walkthrough of model

Page 11: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 11Public

� EXPLAIN PLAN FOR SELECT "MANAGER", SUM("AMOUNT_SOLD")

FROM "_SYS_BIC"."abani.efashion/AN_SALES"

WHERE MANAGER = 'Larry‘GROUP BY "MANAGER";

� HANA Academy: Using Explain Plans: https://www.youtube.com/watch?v=YfkGutsz5Uo� https://help.sap.com/saphelp_hanaone/helpdata/en/20/d9ec5575191014a251e58ecf90997a/content.htm� http://sapbw.optimieren.de/hana/hana/html/sql_explain_plan.html

Explain plan

Page 12: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 12Public

SCN: Visualize Plan & Timeline� http://help.sap.com/saphelp_hanapl atform/helpdata/en/c1/f281fbbb571014aaf38a264c0e12c4/frameset.htm� http://scn.sap.com/community/hana-in-memory/bl og/2015/09/18/littl e-trick-to-check-table-filtering-on- planviz

� http://scn.sap.com/community/hana-in-memory/blog/2012/12/20/show-me-the-timelines-baby

Visualize plan

Page 13: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 13Public

� How to use HDBAdmin to analyze performance traces in SAP HANA http://scn.sap.com/docs/DOC-51110

HDB Admin

Page 14: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 14Public

• Use left outer joins

• Specify cardinality in joins (n:1 or 1:1)

• Set optimize join = true (SP09)

• Use table functions instead of scripted calculation views (SP09).

• Execute in SQL-engine* (HANA live)

Performance Tuning in 30mins

Page 15: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

Deep Dive: the science

Page 16: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 16Public

• No of columns (& rows) scanned

• No of aggregations performed

• Type of calculation required

• No of tables participating in joins

• Size of temporary (internal) tables

• Amount of data transfer between engines

• Degree of parallelization

Performance Tuning: Basics

2bn scans /second /core & 16m aggregations /sec /core

Page 17: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 17Public

• No of columns (& rows) scanned

• No of aggregations performed

• Type of calculation required

• No of tables participating in Joins

• Size of temporary (internal) tables

• Amount of data transfer between engines

• Degree of parallelization

Performance Tuning: Basics

2bn scans /second /core & 16m aggregations /sec /core

ü Filter & cardinality of dataset in DB

ü Cardinality of selected columns

ü Sum vs. distinct count

ü Type of joins & properties

ü Push joins to the lowest level

ü Inefficient use of DB engines*

ü Logical and physical partitioning*

Page 18: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 18Public

Filters

• Reduce the dataset as early as possible. Use design time filters at the lowest level.

• Input Parameter: Placeholders part of the models. ü Can be used in Calculation. Can accept multiple values (SP09)ü Can be derived from table. Can be derived from store procedure (SP09)

• Ensure Variables (where clause) is pushed to the lowest level. Confirm using Visualization Plan.

• Use analytical privilege and SQL analytical privilege (SP10) to filter data.

• Avoid script-based calculation view, WHERE clause will not be pushed down.

• Using Filter is better than using Inner Join to limit the dataset.

• Avoid filters on calculated column (consider materializing these columns).

Page 19: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 19Public

Dealing with high cardinality

• Joins are the most expensive operation. Consider pushing most of the joins (at least on the tables with high cardinality) to the lowest level.üDimension : attribute views and üStar-schema : analytic views or the lowest-node of the calculation view.

• Columns participating in the Joins are also selected (even if not requested) during query execution. Hence direct impact on the cardinality of the dataset.

• Use aggregation node after union nodes in calculation view.

• Be careful with Keep Flag in aggregation node.

Page 20: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 20Public

Type of calculation

• “Distinct count” is a complex operation and very CPU intensive compared to a simple aggregation like “sum” or “count”. CPU usage will exponentially high esp. with high cardinality counters like “Transaction Count”. These counters must be computed in the Analytic View level (where possible).

• Avoid calculation before aggregations (where possible).

• Watch out for currency/unit conversion.

• Attributes used in restricted or calculated measure are also requested and may increase the cardinality of the dataset.

• Calculation with data type conversion are expensive. Avoid where possible.

• Watch out for calculations (like String_Args) which execute in the row-engine.

Page 21: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 21Public

Join pruning

• Specify “Cardinality” for all Joins (1:1, n:1 etc.). Avoid m:n (Cartesian product)

• Consider using Left Outer or Referential Joins (vs. Inner Join)

• Referential Join to attribute view (with design time filter) will behave as “Inner Join”

• Specify “Optimize Join = True” for Left Outer and Text Joins (SP09 onwards)

• Avoid Right Outer Joins

• Temporal Join to attribute views (with design time filter) will always execute.

• Avoid Joins on “Calculated Columns” (consider materializing these columns)

Page 22: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 22Public

Model pruning

• Consider using Constant Mapping in UNIONs for efficient model pruning.

Page 23: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 23Public

Use of DB engines

• Execute in SQL Engineü recommended for HANA live* models.

• Use table function vs. scripted calculation viewsü migration option in studio (SP09)

Page 24: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 24Public

Degree of parallelization

• Consider using UNION in place of JOINS in calculation view, esp. while dealing with similar dataset (plan & actual).

• Implementing a logical partitioning model, may reduce query runtime but will increase CPU usage.

• Avoid single datasource (or node) feeding multiple nodes in calculation view.

Page 25: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 25Public

Reduce network data transfer

• To reduce the network data transfer (i.e. to push the joins to each node) in a scale-out deploymentü Collocate the master and fact data tables in the same nodeü Replicate master data to all nodes (if the fact table is distributed across multiple node)ü Tables in _SYS_BI schema can’t be replicated to all nodes

• Consider applying multi-level partitioning with hash-partitioning (on single field) in the first level. This will ensure, calculations can be computed on each node and each partition.

Page 26: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 26Public

Caching

• Introduced in SP08. Improved in SP09.ü for complex* queries onlyü an option to improve concurrency

Page 27: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

Deep Dive: the art

Page 28: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 28Public

Modeling approach: follow the measures

• Consider building models with a star-schema/cube. The fact table (measures) is surrounded by various dimensions. The star-schema can be built using analytic views or star-join calculation views (comparable performance in SP09).

• Dimensions should be built as attribute views or dimension-calculation views.

• Only business logics (very minimal joins) on top of the star-schema.

Fact Table

DimensionDimension

DimensionDimension

OLAP Engine is the fastest engine in HANA.

Page 29: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 29Public

Modeling approach: follow the measures

Before After

Page 30: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 30Public

Building it right: the first time

• Move Business Logic into HANA

• Performance tuning is not a separate activity. Keep an eye of the query performance as you model.

• Test the model early and when small (after the first join). Thoroughly test the model (all join fields & calculated columns) before moving to the next. Almost complete is not good enough.

• Ensure tables are pruned when not queried and where clause pushed down to the table-level. Check and confirm using plan visualization.

Page 31: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 31Public

Transformation

• Degree of transformation or materialization• Master data (dimension)

ü recommended to simplify models (fields used in joins or filters) (same or new table)

• Transaction (fact) data:ü recommended to simplify models (fields used in joins or filters) (same table)ü acceptable to simplify models (calculation before aggregation, data type conversion) (same table)ü avoid creating aggregates/materialized table (absolute last option)

Page 32: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 32Public

SAP HANA Modeling health check

Minimize data transfer between Analytical views, Calculation views & front end tools (or SAP HANA clients)

Avoid executing open ended queries (using KEYs)

Reducing the data set as early as possible

Enforce data aggregation (GROUP BYs) using fewer (and more granular) dimensions

Use data filters (WHERE clauses, prompts, constraint filters & Analytical privileges)

Imbed business logic calculations into modeled views instead of within SQL statements, Procedures, Universes or front end

Minimize the use of expensive calculations, row based expressions & data manipulation including Calculated attributes

Transform complex expressions before hand using SLT, Data Services or Generated Columns

Use Unions (with constants) to combine large data sets

Join views (within Calculation Views, within Universes or using SQL) with caution. Use WHERE clauses + data filters that can be pushed down into each view

Define cardinality N:1 fact to dimension (star schema) & enforce left-outer join where possible

Minimize long join chains and big data set joins. Where possible move data foundation joins into Attribute views

Data transfer Joins

Calculations

Page 33: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 33Public

HANA SP11 and beyond

• Primary use of calculation views: In future releases (SP11 and beyond), HANA optimizer will select appropriate engines during query execution. This will eliminate the need for creating different types of views for different engines (i.e. star-join in calculation view will be comparable to analytic view). However the model design principles remains the same. We’ll still create dimensions & star-schema views, but using calculation views.

• Support of existing Views: HANA will be backyard compatible and will still support analytic & attribute views. Also a migration tool may be available to convert the attribute and analytic views to calculation views.

Page 34: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

Customer Workshop

Page 35: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 35Public

Beverage Major

• Statsü before: 5mins, after: 3sec

• Changes (SP08)ü Move business logic to HANA layerü Efficient SQL query (some were 5000 lines)ü Use appropriate filterü Avoid single node feeding multiple nodes.ü Constant mapping in unions

Page 36: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 36Public

Pension Plan Management

• Statsü before: 30sec, after: 3secü before: 2min (concurrency 5), after: 7 sec (concurrency 15)

• Changes (SP08, HEC)ü Efficient SQL queryü Implement star-schema (analytical view)ü Push high cardinality joins to the lowest level (analytic & attribute views)ü Use left outer joins. Set cardinality (n:1 or 1:1)ü Convert joins to unions (esp. joins of analytical views)ü Avoid single node feeding multiple nodes.ü Avoid decision table and scripted-calculation view*

Page 37: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 37Public

Grocery Retailer

• Statsü before: 19sec, after: 300ms (1 user)

• Changes (SP08)ü Implement star-schema (analytical view)ü Push high cardinality joins to the lowest levelü Convert joins to unions.ü Use left outer joins. Set cardinality (n:1 or 1:1)ü Avoid single node feeding multiple nodes.

Before After

Page 38: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 38Public

Audit Firm

• Stats• Firm Stats

ü before: 19min, after: 8sec (1 user)• My Statsü before: 17sec, after: 1sec ü before: 2min (concurrency 10), after 40sec

(concurrency 400)

• Changes (SP09)ü Efficient SQL queryü Use left outer joins. Set cardinality (n:1 or 1:1)ü Set optimize join = true (SP09)ü Scripted calculation views to table functions (SP09).ü Push high cardinality joins to the lowest level

Page 39: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 39Public

Questions & Answers

Please follow the blog post for Questions & Answers

https://scn.sap.com/community/hana-in-memory/blog/2015/11/03/the-art-and-science-of-hana-performance-modeling

Page 40: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved.

Thank youContact information:

Abani Pattanayak, SAP HANA Distinguished EngineerPrincipal Consultant, SAP HANA [email protected] / 1 647-406-3392

Page 41: The Art Science of Tuning HANA Models for Performance IFG ...hdespot.com/wp-content/uploads/2015/11/SAPHDE_Webinar-The-Art... · Abani Pattanayak, SAP HANA CoE Nov 12, 2015 The Arts

© 2015 SAP SE or an SAP affiliate company. All rights reserved. 41Public

© 2015 SAP SE or an SAP affiliate company. All rights reserved.

No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission ofSAP SE or an SAP affiliate company.

SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE (or an SAP affiliate company) in Germany and other countries. Please see http://global12.sap.com/corporate-en/legal/copyright/index.epxfor additional trademark information and notices.

Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors.

National product specifications may vary.

These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind, and SAP SE or its affiliated companies shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP SE or SAP affiliate company products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.

In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related presentation, or to develop or release any functionality mentioned therein. This document, or any related presentation, and SAP SE’s or its affiliated companies’ strategy and possible future developments, products, and/or platform directions and functionality are all subject to change and may be changed by SAP SE or its affiliated companies at any time for any reason without notice. The information in this document is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. All forward-looking statements are subject to various risks and uncertainties that could cause actual results to differ materially from expectations. Readers are cautioned not to place undue reliance on these forward-looking statements, which speak only as of their dates, and they should not be relied upon in making purchasing decisions.