11-01-2007 7:54 AM
Hi Folks,
We haev a requirement where we need to query 7 tables to retrieve some data and display it in the form of a list.
This report is to be executed in background.
Right now we have 3 select statements, each of which has inner joins on 2-3 tables and uses "for all entries".
Performance wise which would be a better option - to keep it this way, or have separate select statement for each table and then read statements on internal tabels for output?
Thanks in advance,
Munish
11-01-2007 7:57 AM
Hi Munish,
This depend on the table in consideration and the number of entries, Selction screen fields which can be used in WHERE clause, etc
So I think you can take a decision on these parameters as well you can do the sql trace using ST05 and find out which is better.
Regards,
Atish
11-01-2007 7:57 AM
Hi Munish,
This depend on the table in consideration and the number of entries, Selction screen fields which can be used in WHERE clause, etc
So I think you can take a decision on these parameters as well you can do the sql trace using ST05 and find out which is better.
Regards,
Atish
11-01-2007 8:17 AM
Hi,
I think it depends on the balance between ABAP time and Database time.
If you select all the data from tables independently and then do looping etc,
it will increase the hits as well as the ABAP time.
So the next best option is a mix of both. I believe the current approach holds good.
As, has been mentioned before also in this thread, you can improve the performance if the joins are being made on key fields since this reduced overhead.
If I were using tables which had all been joined with key fields I would have gone as high as with 5 Joins but I guess this is an ideal scenario so a join of 2-3 tables is a decent approach.
And the subsequent handling in ABAP is the only next step.
So this approach is fine and you should incorporate correct performance guidelines which you can find in this forum if you search for them.
Regards
Nishant
11-01-2007 9:21 AM
Thanks for the replies guys!!
For the last 2 hours I have been going through the posts looking for the clues.. and i guess its gonna take a bit more than simply choosing between inner join or for all entries
11-01-2007 1:15 PM
The performance differences between FOR ALL ENTRIES and JOINs is not that great; the important thing is the effective use of indexes.
Rob
11-02-2007 2:25 PM
Thanks Rob!
Infact yesterday I went through your and Siegfried's posts and articles only. Its only then that I realized that there s no step-by-step procedure for this. Really enjoyed reading your insightful posts. Thanks again
11-01-2007 2:04 PM
Create a view joining (inner joins) as many tables as possible. You can also specify the selection conditions in your view. This will improve the performance.
11-02-2007 3:15 PM