‎2007 Aug 15 4:16 PM
My report executes very slow. What are things I can do to better improve the performance.
‎2007 Aug 15 4:31 PM
Run the ABAP Trace
1. Execute your report
2. Call SE30
3. Execute your report from SE30
4. Analyze it, check total runtime, and ABAP and DB time
5. Go to hitlist, sort by net time, copy 10 Top consumer, check their coding
If DB time is more than 50% in total, or if there are some database statements
in the Top 10, then run SQL trace
1. Execute your report
2. Call ST05 in parallel
3. Execute your report
4. STOP St05 and Display Results
5. IMPORTANT !!!!! Go to Tables -> Summarize by SQL Statements
6. => List of SQL Statements, Check again Top 10
Ask again with more information!
Siegfried
5. Go to hitlist, sort by net time, copy 10 Top consumer, check their coding
‎2007 Aug 15 4:30 PM
Megan,
We can do a lot of things. For the start, lets try.
Type and size of Table-
Choose Transparent and Small Tables
Database Retrieval-
Retrieve by Primary / Secondary index
Use aggregate functions in SELECT
Fill the ITAB in SELECT st. only
Use Field Groups
Use SELECT <fld> rather than SELECT *
Avoid Corresponding or Move
Corresponding for bigger tables
Use WHERE st. with INDEX order
While fetching single record from the db use SELECT SINGLE *
Try to use FOR ALL ENTRIES
Clear the buffer in ST10
Regards
Aneesh
~~Copied from some document that I have written by Natasha.
‎2007 Aug 15 4:31 PM
Run the ABAP Trace
1. Execute your report
2. Call SE30
3. Execute your report from SE30
4. Analyze it, check total runtime, and ABAP and DB time
5. Go to hitlist, sort by net time, copy 10 Top consumer, check their coding
If DB time is more than 50% in total, or if there are some database statements
in the Top 10, then run SQL trace
1. Execute your report
2. Call ST05 in parallel
3. Execute your report
4. STOP St05 and Display Results
5. IMPORTANT !!!!! Go to Tables -> Summarize by SQL Statements
6. => List of SQL Statements, Check again Top 10
Ask again with more information!
Siegfried
5. Go to hitlist, sort by net time, copy 10 Top consumer, check their coding
‎2007 Aug 15 5:12 PM
I have done the SQL trace and the top ten on the hit list are DB accesses. To be precise they are hits to tbl AFPO & QALS. I looked at the dictionary info for the objects and it says Buffering is not allowed. Could that be the reason for the slow performance. The code thats causing the slowness is a join between AFPO & QALS with 4 where conditions. I use it to extract the manufacturing plant for a material. Any ideas of how to improve on this?
SELECT SINGLE afpo~dwerk
INTO gv_werks_mfg
FROM afpo INNER JOIN qals
ON afpo~aufnr = qals~aufnr
WHERE qals~matnr = collector-matnr
AND qals~charg = collector-charg
AND qals~art = c_manualinsp
AND qals~herkunft = c_gr_prod.
‎2007 Aug 17 8:20 AM
I have really not much time right now, so I would recommend you to open a new question, nobody will look into an 'answered' one.
Write down your statement plus the indexes on the two tables (order of fields)
=> from that one can conclude, how the optimal access would work and whether
suitable indexes are there.
Plus the information which indexes are used right now, can be found in the SQL trace (explain, but unfortunately the explain has different layouts for different databases.) => What is actually done.
Siegfried
‎2007 Aug 17 6:33 PM
If there are not more than 3 indexes on QALS table, try creating one using the fields in the select.
hope that helps.
rgds,
raj