title: Performance Tuning for an insert query
body: <p>Can someone help me in tuning this query as I am new to performance tuning in oracle. </p>
  
  <pre><code>INSERT INTO mdm_id_relation
      SELECT 
          pat_key, hub_pat_id, msa_pat_id, pat_id
      FROM 
          ods_raw_patient_mdm_process p1
      WHERE NVL (pat_id, 'NULL') IN (SELECT pat_id
                                     FROM mdm_id_relation)
        AND NOT EXISTS (SELECT pat_key
                        FROM mdm_id_relation p2
                        WHERE p1.pat_key = p2.pat_key);
  </code></pre>