‎2014 May 13 4:15 AM
When I develop a report , I write some select statements, when I write down those statements I want to analyze my statements is there any chance to optimize it, such as using some table index, or using join or not use the for all entries ?
Is there any tool to analysis the SQL statements ?
‎2014 May 13 4:32 AM
Goang, you should use the std transaction ST05 for this purpose. Activate the trace in this transaction. Then run your report. Then go back to st05 and deactivate the trace and then display. The display will show all your SQL statements
You can use the explain option to understand what index what used by the DB and alsothe cost involved on the select. There are lots documents available when u search for ST05.
Also you can run run time analysis using SE30. This will not only tell you about SQL statements but will also include much more information regarding the overall execution of your report.
Thanks,
Vikram
‎2014 May 13 4:32 AM
Goang, you should use the std transaction ST05 for this purpose. Activate the trace in this transaction. Then run your report. Then go back to st05 and deactivate the trace and then display. The display will show all your SQL statements
You can use the explain option to understand what index what used by the DB and alsothe cost involved on the select. There are lots documents available when u search for ST05.
Also you can run run time analysis using SE30. This will not only tell you about SQL statements but will also include much more information regarding the overall execution of your report.
Thanks,
Vikram
‎2014 May 13 4:54 AM
Hi Vikran,
Other option is to check with DBA team. You need to provide them the SELECT query(using secondry inex) and further, they will run it in SQL Server and can provide you the query processing time.
Regards,
Sudeesh Soni
‎2014 May 13 5:19 AM
Hi zhang,
you should not force the use of an index with hints but to create appropriate indexes and recalculate table statistics so that SGBD selects automatically the correct index to use.
Check Explain Plan - ABAP Development - SCN Wiki for some information regarding above mentioned transactions. I find the "Enter SQL Statement" functionality particularly useful.
regards,
Edgar