title: Oracle: Fast NOT IN for multiple columns
body: <p>I need to synchronize two tables. Let's assume that the tables contain following columns:  </p>
  
  <pre><code>Table1: A, B, C, D  
  Table2: A, B, C, E
  </code></pre>
  
  <p>I need to find such rows in Table1 that there isn't entry with corresponding <code>(A, B, C)</code> values in Table2, then calculate E as F(D) and update Table2.  </p>
  
  <p>If I need to match e.g. only A, I would write the following query:</p>
  
  <pre><code>SELECT * FROM Table1 WHERE A NOT IN (SELECT A FROM Table2)
  </code></pre>
  
  <p>Multi-column analog seems to be too slow:</p>
  
  <pre><code>SELECT * FROM Table1 WHERE A NOT IN (SELECT A FROM Table2)
                         AND B NOT IN (SELECT B FROM Table2)
                         AND C NOT IN (SELECT C FROM Table2)
  </code></pre>
  
  <p>What is the best way to write such query?</p>