SQL Cockpit & SAP HANA Verify your SQL queries for HANAsuitability Johann Fößleitner Cadaxo GmbH email: johann.foessleitner@cadaxo.com Twitter: @foessleitnerj
Agenda 1 SAP HANA Integration Scenarios (Business Suite) 2 Golden SQL Rules 3 HANA Objects in ABAP 4 Analysis / Monitoring Tools in SAP Standard 5 Cadaxo SQL Cockpit 6 Questions & answers, further information
What impact does a conversion to HANA have on client programs? Programs run predominantly continue running problem-free Many queries are considerably faster Some queries behave the same after the conversion Isolated queries can have reduced performance ABAP Open SQL Native SQL DB Hints ADBC (DB Features) Programs must be verified Change to Open SQL if possible DB Hints tested/adjusted ADBC access tested/adjusted
Agenda 1 SAP Hana integration scenarios (Business Suite) 2 Golden SQL Rules 3 HANA Objects in ABAP 4 Analysis / Monitoring Tools in SAP Standard 5 Cadaxo SQL Cockpit 6 Questions & answers, further information
Business Suite SAP HANA Scenarios SAP ABAP Application Server SAP ABAP Application Server SAP ABAP Application Server Read / Write, primary connection Read / Write, primary connection Read only, secondary connection Read / Write, primary connection Read/Write, secondary connection SAP HANA AnyDB (Traditional) Replikation SLT SAP HANA AnyDB (Traditional) SAP HANA Integrated Side-by-Side
Agenda 1 SAP Hana integration scenarios (Business Suite) 2 Golden SQL Rules 3 HANA Objects in ABAP 4 Analysis / Monitoring Tools in SAP Standard 5 Cadaxo SQL Cockpit 6 Questions & answers, further information
Golden SQL Rules The golden SQL Rules are just as applicable in the HANA environment as in other DB environments
The golden SQL Rules Result set should be kept small Amount of data should be kept to a minimum Number of data transfers should be minimised Secondary indices should be used Redundant queries should be avoided
Die goldenen SQL Regeln Resultset should be kept small Amount of data should be kept to a minimum Number of data transfers should be minimised Secondary indices should be used Redundant queries should be avoided
Result set should be kept small Don t use SELECT CHECK/EXIT ENDSELECT WHERE-clause should be as specific as possible
Amount of data should be kept to a minimum Avoid using SELECT * Use aggregate functions (COUNT, SUM, )
Number of data transfers should be minimised Joins and Subselects should be used Use SELECT for all ENTRIES INSERT/UPDATE, FROM TABLE should be used
Secondary indices should be used Meaningful secondary indices should be created/implemented Access of the secondary indices should be tested
Redundant queries should be avoided Redundant read access should be avoided Table buffering should be activated Perform sorting of the bulk data in ABAP
Agenda 1 SAP Hana integration scenarios (Business Suite) 2 Golden SQL Rules 3 HANA Objects in ABAP 4 Analysis / Monitoring Tools in SAP Standard 5 Cadaxo SQL Cockpit 6 Questions & answers, further information
Side-by-Side ABAP/HANA Open SQL / Connection SELECT <column> from <table> connection HDB where Very simple Tables must be defined in ABAP dictionary No access to analytical views, HANA procedures, Native SQL EXEC SQL. connect to 'HDB' as 'HDB' ENDEXEC. EXEC SQL. open ENDEXEC. Access to HANA Objects (procedures, ) Higher implementation complexity ADBC (ABAP Database Connectivity) CL_SQL_CONNECTION=>GET_CONNECTION( con_name = HDB ). Access to HANA Objects (procedures, ) Simpler to implement than native SQL
Integrated ABAP/HANA Open SQL As before SELECT <column> from <table> where External Views SELECT <column> from <hana_view> where Generation of external views in HANA Studio Analytical Views, Access with normal ABAP Open SQL HANA Prozeduren (DB Proxy) Proxy generation of procedures in HANA Studio CALL DATABASE PROCEDURE
Agenda 1 SAP Hana integration scenarios (Business Suite) 2 Golden SQL Rules 3 HANA Objects in ABAP 4 Analysis / Monitoring Tools in SAP Standard 5 Cadaxo SQL Cockpit 6 Questions & answers, further information
How do I find ABAP (SQL) coding to be potentially optimized/corrected? Static checks Code Inspector ABAP Test Cockpit (ATC) Monitoring tools in ABAP SQL Trace (ST05) Runtime Analysis (SAT) SQL Monitor (SQLM)* SQL Performance Tuning Worklist (SWLT)* Coverage Analyzer 3rd Party tools Monitoring tools at DB level DB dependant SQL monitoring tools * Available from 7.40 in Standard
Code Inspector Static performance tests Many SQL relevant tests are available SELECT *, Indices, Nested LOOP, Analyses don t distinguish, if it concerns dead coding if the coding sequence is often used i.e. if it is relevant for optimization Dynamic SQL queries can not be analysed
SQL Monitor Logs all SQL queries Implementation in productive environment is possible with little/no impact on performance Can also be utilized for non-hana based SAP Systems E.g. BEFORE a HANA-conversion Available from NW 7.00
SQL Performance Tuning Worklist Combines static tests (Code Inspector, ABAP Test Cockpit) with related SQL Monitor results Ideal combination to pin-point SQL queries to be optimized
Agenda 1 SAP Hana integration scenarios (Business Suite) 2 Golden SQL Rules 3 HANA Objects in ABAP 4 Analysis / Monitoring Tools in SAP Standard 5 Cadaxo SQL Cockpit 6 Questions & answers, further information
ABAP Open SQL Database Viewer
Area of application Acceleration of IT processes Support Development Test management Data consistency Knowledge sharing tool
Overview
Some clients using SQL Cockpit:
Live presentation of SQL Cockpit
SQL Cockpit versions Standard Edition SQL Viewer/Editor No database manipulation possible Premium Edition Traceable changes directly on table level Verified by E&Y* * KFS/DV1 Accepted IT accounting principles
Agenda 1 SAP Hana integration scenarios (Business Suite) 2 Golden SQL Rules 3 HANA Objects in ABAP 4 Analysis / Monitoring Tools in SAP Standard 5 Cadaxo SQL Cockpit 6 Questions & answers, further information
Questions & Answers
Further information ABAP und SAP HANA http://www.saphana.com http://sdn.sap.com/community/abap/hana SAP Press: ABAP Development for SAP Hana ISBN 978-1-59229-859-4 http://www.sap-press.com/products/abap-development-for-sap-hana.html SQL Cockpit http://www.cadaxo.com/content/en/products http://www.youtube.com/user/cadaxogmbh Interesting SAP Notes SQL Monitor: 1885926, 1806015, 1831460, SAP Hana: 1812713,
Cadaxo GmbH, found in 2009 in Vienna, Austria, is an established, innovative SAP Consulting company, with the goal to simplify everyday working life with SAP. www.cadaxo.com SQL Cockpit The best solution for Businessusers, Software-developers and Support! http://www.cadaxo.com/content/de/produkte.html http://com.slideshare.net/cadaxogmbh http://www.youtube.com/cadaxogmbh https://twitter.com/cadaxo http://www.linkedin.com/company/cadaxo-gmbh