09-08-2008 7:55 AM
hi,
if i join two tables by innerjoining will it effect the performance?If such,how i can join these with better performance?can i get the data from different tables in a single internal table by appending different structures in this case?Please answer me.
09-08-2008 8:03 AM
09-08-2008 7:57 AM
09-08-2008 7:58 AM
use FOR ALL ENTRIES instead of INNER JOINS.
Inner Joins more than two levels will have great impact on performance.
09-08-2008 7:59 AM
YES. Using of inner join will affect the performance.
do it in the following way,
Step 1.
take 2 internal table compatible to each of the database table.
Step 2.
Use SELECT query in 1st data table keeping the field sequence of in where clause same as that of the table
Step3.
use 2 nd SELECT query to fetch data from the 2nd table using FOR ALL ENTRIES
For syntax and sample code, check,
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3a1f358411d1829f0000e829fbfe/content.htm
step4:
LOOP at itab1.
READ itab2
assign value to final table field
Append the data
Regards,
Anirban
09-08-2008 8:02 AM
Hi Debabina,
You may ceate an internal table which has both the table fields, bit these two tables should be releated to each other.
How do you process the table will decide the performance.
09-08-2008 8:03 AM
09-08-2008 8:07 AM
If inner Join has a performance issue the best thing u can do is...
Create 3 int tables. "This is to avoid 'INTO CORRESPONDING FIELDS' select query which will affect performance.
itab1 with the structure of table1
itab2 with the structure of table2
itab3 with the structure of table1 & table2
Select from 1st table into itab1.
if itab1 is not initial.
select from table 2 into itab2 for all entries in itab1 where field = itab1-field.
sort itab2 by field. "For binary search
loop itab1.
move-corresponding itab1 to itab3.
read itab2 with key field = itab1-field binary search.
move-corresponding itab2 to itab3.
append itab3.
endloop.
Regards
Sathar
Edited by: Sathar RA on Sep 8, 2008 9:10 AM
09-08-2008 8:14 AM
Hi,
Inner Joins would surely give you performance issue.
However, do not try to put the data from 2 data base tables into single internal table........This will as well create performance issue for you....
There is no problem with inner joins if the tables are not Transaction tables....Also, put the data into 2 separate internal tables...
This would be better as per your scenario....
Regards,
Kunjal