03-12-2010 11:19 PM
Hi guru, I need to compare two big SAP tables and only select the records that exist in Table A but not in Table B, i.e. Exclude the records that exist in both tables. Due to the volume, left outer join is not preferred. Does anybody know any smart and quick way to do so?
Thanks,
03-13-2010 1:47 AM
Sounds like you're looking for alternatives from performance perspective, so maybe your question would be better posed in .
As always for any performance related questions the answer is: It depends...
I.e. you need to provide some further background: How many entries in table A, how many in table B? How are they linked (e.g. index, primary key, what fields)? On average, how many entries do you expect in your result set?
Depending on those parameters (and possibly others) one can then evaluate other options: There's probably not many, I'd try also using [subqueries|http://help.sap.com/abapdocu_70/en/ABENWHERE_LOGEXP_SUBQUERY.htm]. Since performance tuning always requires an analysis, it's best to try out the different variations and check what happens (e.g. how long do they run, what kind of load do they introduce on the database, etc.). Subquery versus outer join performance depends also on the used database.
Cheers, harald
03-13-2010 1:47 AM
Sounds like you're looking for alternatives from performance perspective, so maybe your question would be better posed in .
As always for any performance related questions the answer is: It depends...
I.e. you need to provide some further background: How many entries in table A, how many in table B? How are they linked (e.g. index, primary key, what fields)? On average, how many entries do you expect in your result set?
Depending on those parameters (and possibly others) one can then evaluate other options: There's probably not many, I'd try also using [subqueries|http://help.sap.com/abapdocu_70/en/ABENWHERE_LOGEXP_SUBQUERY.htm]. Since performance tuning always requires an analysis, it's best to try out the different variations and check what happens (e.g. how long do they run, what kind of load do they introduce on the database, etc.). Subquery versus outer join performance depends also on the used database.
Cheers, harald