How to Find Database Index usage per ABAP Report and Creating an Index Applies to: SAP NETWEAVER WEB AS ABAP. For more information, visit the ABAP homepage Summary The aim of this article is to show how to find which table and index is being used by a long running ABAP report. This document can be used to improve the server performance by identifying the used index and if usage is not upto required standards leading to long running times, then create a new index to increase performance. This is more useful for lower releases of SAP R/3 servers and ADD In installations. Author: Hemanth Kumar Company: SAP Created on: 18 July 2011 Author Bio Hemanth is a senior SAP netweaver consultant working with SAP Active Global Support. 2011 SAP AG 1
Table of Contents Introduction... 3 Step 1- Identifying the long running report... 3 Step 2- ST04 Database performance analysis... 3 Step 3 SQL requests... 4 Step 4 Run the resource consuming report... 5 Step 5 Identifying the table being used... 5 Step 6 SQL statements accessing PCL4 table... 5 Step 7 Index and fields analysis... 6 Step 8 Adding new index to optimize more... 7 Step 9 Indexes currently created and adding new one if necessary.... 7 Step 10 Creating an Index... 8 Related Content... 9 Copyright... 10 2011 SAP AG 2
Introduction There are cases when server administrators notice that the performance of the server goes down tremendously when certain reports are run on the system irrespective of whether they are configured as background jobs or not. This article takes an example report and shows how to identify such a performance bottlenecks and improve the same by identifying the table being accessed and creating a new index to suit just the need of this high load /system resources consuming report. This will lead to swift processing of the report as the fields to be searched will be less leading to faster access and updation. Step 1- Identifying the long running report Login to the R/3 server and check the background jobs to identify the long running report. Or by usual system monitoring, such long running reports can be isolated. In this case for example purposes, we have taken the audit report RPUAUD000 which is used to display all changes that were made using infotype change documents. Step 2- ST04 Database performance analysis Navigate to TCode /n ST04 and click on detailed analysis menu for more options. 2011 SAP AG 3
Step 3 SQL requests Click on SQL request to get a list of DB statements/access running on the server presently. Now sort as per buffer gets and click on execute. 2011 SAP AG 4
Step 4 Run the resource consuming report Now open another SAP session and navigate to TCode /n SE38 to manually run the audit report RPUAUD000 after entering the required data. Step 5 Identifying the table being used There are several ways to identify the database table being accessed, but the easiest will be to navigate to TCode /n SM50 and check the tables being accessed. Narrow down with user name and client details to identify the table for the report being run. In this case it is PCL4 table. Step 6 SQL statements accessing PCL4 table Now that the table being accessed is identified, navigate back to /n ST04 and search for PCL4 table. Click on GOTO-> Find table. Enter the table name and click on execute. 2011 SAP AG 5
Step 7 Index and fields analysis Select the table and click to access more details. More details about the index being used, fields and estimated costs/estimated rows are depicted. 2011 SAP AG 6
Step 8 Adding new index to optimize more If the amount of access is on the higher end, adding an index with only the fields that is being accessed by the report will be useful as it will ensure that the database access is overall less leading to more faster data retrieval. Navigate to /n SE12 to check more details of the database table PCL4. Step 9 Indexes currently created and adding new one if necessary. The TCode shows the fields that are present for the table and to find the list of indexes currently configured on the server, click on the tab as below: As of now, 3 indexes are created on the server. If choose is clicked, then more details about the fields being used are shown. 2011 SAP AG 7
Step 10 Creating an Index If the server administrator feels that a new index can be created with less fields to be accessed so that the report runs faster then click on create and enter the below details. Once the index has been created, do not forget to activate it. Note: It is always recommended to first create the index in the development server, check the performance and then if deemed necessary, to be transported to the test and the production server. However this should be done only after careful testing. The index details can also be passed to the developers concerned so that they can write custom programs with index data included so that they can run faster. 2011 SAP AG 8
Related Content Transaction Code ST04 DATABASE MONITOR DATABASE PERFORMANCE For more information, visit the ABAP homepage 2011 SAP AG 9
Copyright Copyright 2011 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. Microsoft, Windows, Excel, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. IBM, DB2, DB2 Universal Database, System i, System i5, System p, System p5, System x, System z, System z10, System z9, z10, z9, iseries, pseries, xseries, 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, POWER5+, POWER5, POWER, OpenPower, PowerPC, BatchPipes, BladeCenter, System Storage, GPFS, HACMP, RETAIN, DB2 Connect, RACF, Redbooks, OS/2, Parallel Sysplex, MVS/ESA, AIX, Intelligent Miner, WebSphere, Netfinity, Tivoli and Informix are trademarks or registered trademarks of IBM Corporation. Linux is the registered trademark of Linus Torvalds in the U.S. and other countries. Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks of Adobe Systems Incorporated in the United States and/or other countries. Oracle is a registered trademark of Oracle Corporation. 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. Java is a registered trademark of Oracle Corporation. JavaScript is a registered trademark of Oracle Corporation, used under license for technology invented and implemented by Netscape. SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP Business ByDesign, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries. Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal Decisions, Web Intelligence, Xcelsius, and other Business Objects products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Business Objects S.A. in the United States and in other countries. Business Objects is an SAP company. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group 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. 2011 SAP AG 10