title: Removing non-adjacent duplicates comparing all fields
body: <p>What is the most (time) efficient way of removing all exact duplicates from an unsorted standard internal table (non-deep structure, arbitrarily large)?</p>
  
  <p>All I can think of is simply sorting the entire thing by all of its fields before running <code>DELETE ADJACENT DUPLICATES FROM itab COMPARING ALL FIELDS</code>. Is there a faster or preferred alternative? Will this cause problems if the structure mixes alphanumeric fields with numerics?</p>
  
  <p>To provide context, I'm trying to improve performance on some horrible select logic in legacy programs. Most of these run full table scans on 5-10 joined tables, some of them self-joining. I'm left with hundreds of thousands of rows in memory and I'm fairly sure a large portion of them are just duplicates. However, changing the actual selects is too complex and would require <em>/ex[tp]ensive/</em> retesting. Just removing duplicates would likely cut runtime in half but I want to make sure that the deduplication doesn't add too much overhead itself.</p>