‎2007 Jul 12 3:19 PM
Hi,
I have a big report having a large selection from data base. I have to optimize it. When i did run time analysis, it shows that 99.4% is the database load for this report. Can anybody tell me how to reduce this databse load, or what are the recommended points to reduce database load, so my report will run fast.
Thanks,
‎2007 Jul 12 3:22 PM
Avoid nested select statements.
Avoid select * statements and select only those fields that are really necessary.
avoid selects inside loop statements and use for all entries statement instead.
There are a lot more, just search the forum for ABAP PERFORMANCE TUNING.
Regards,
Ravi
‎2007 Jul 12 3:33 PM
Go in the runtime analysis and try to pinpoint where your workload is.
If 94% of the time was DB related you have select statements that are either too heavy or too often called.
Check in the results of the run time analysis for the following:
1 - Highest GROSS execution time SELECT SINGLE or FETCH statement. Since the runtime analysis is default sorted descending by GROSS execution time, the first result of this type should be a good indication of where your problem is.
2 - Sometimes the highest execution time is a result of nested select statements, meaning that a particular select is called in a loop and therefore too many times.
Once you find the results in SE30, it should tell you which tables and you will even be able to drill down directly to the code (select statement).
There evaluate if you are processing your select the most efficient way, using the full key or table indexes. Also consider using select for all entries in ITAB instead of select>select>endselect>endselect.
Hope it helps. If not, please post here your report.
Leonardo De Araujo
‎2007 Jul 12 3:38 PM
Try avoiding
1) select * statements
2) select statements within Loop
3) create index for fields in where condition on a table
4) try using join statements
5) Avoid multiple retrieval of data from same table... fetch only once and use it
6) if possible use views or function modules
‎2007 Jul 12 3:41 PM
Hi,
- Everywhere it is possible, don't use select * and write the list of fields you need to get.
- Check the code for redundant selections
- Don't use SELECT/ENDSELECT statement : this is very slow. Instead of that use SELECT with APPENDING TABLE option and store results in an internal table.
- Check WHERE conditions : try to put as much key fields as possible.
- If you're making repetitive selections on the same table, maybe you should try to make one mass extraction of this table into an internal table and make selections in your program instead of doing multiple requests to the database.
- Use inner joins
- Use FOR ALL ENTRIES option if possible
Please reward points if this is useful.
Regards,
Nicolas.