Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9129

Re: Comparing two Internal tables

$
0
0

Hi Uma,

 

for large mass data, doing anything in the LOOP is much slower than mass processing statements like DELETE WHERE.


Still, I would try adding a deletion flag to each item, set the flag in a LOOP and use DELETE WHERE flag = 'X' at the end of the loop.

 

Next I would implement a poor man's table index management to benefit from the performance of the DELETE statement. Create a mapping table and work with an index table, i.e. a table containing the index of the entry in the original table. e.g.

 

 

Internal Table1                         Mapping                      Index Table

 

Field1                                      Index Field                                  

 

 

A                                              3 A                                              3

  

B                                              4 B                                              4

 

C                                              1 C                                              1

 

D                                              2 D                                              2  

 

The index are chosen in a way that all entries in the reference table have the lowest index.

With this, you can now DELETE WHERE index LE 2, then do the reverse mapping.

 

I used this once (class LCL_TRACE_INDEX) to benefit from the performance of FIND IN TABLE in pattern matching. You will have to decide if it is worth the effort.

 

Hope this helps,

 

JNN


Viewing all articles
Browse latest Browse all 9129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>