title: How can I improve performance?
body: <pre><code>INSERT INTO TableTemp (......)
  SELECT .....
  FROM ViewTable cs
  WHERE NOT EXISTS (
  
      SELECT *
  
      FROM TableA s
  
      WHERE s.location_locCode = cs.store
      AND s.stockUnit_country = cs.country
      AND s.stockUnit_upcCode = cs.upc
  )
  and EXISTS (
  
      SELECT *
  
      FROM TableB l
  
      WHERE cs.store = l.locCode
      AND cs.country=l.country
  );
  </code></pre>
  
  <p>The above sql statement is too slow.</p>
  
  <p>How can I improve performance?</p>
  
  <p>A TableView is a view, a view that has data remotely from another server.</p>
  
  <p>index : 
  [TableA]
    country, skuItem
    country, skuCode
    country, upcCode
  [TableB]
    locCode, country
    locCode</p>