title: mysql NOT IN QUERY optimize
body: <p>I have two tables named as:</p>
  
  <ol>
  <li>table_product </li>
  <li>table_user_ownned_auction</li>
  </ol>
  
  <h3>table_product</h3>
  
  <pre><code>specific_product_id      astatus  ... 
  (primary_key,autoinc)
  --------------------------------------
  1                        APAST    ...
  2                        ALIVE    ...
  3                        ALIVE    ...
  4                        APAST    ... 
  5                        APAST    ...
  </code></pre>
  
  <h3>table_user_ownned_auction</h3>
  
  <pre><code>own_id     specific_product_id   details   
  ----------------------------------------
  1                  1               XXXX
  2                  5               XXXX
  </code></pre>
  
  <p>I need to select <code>atatus = APAST</code>, and not in table 2.<br>
  Which means, in above structure table1 has 3 APAST status (1,4,5). But in table 2  specific_product_id (1,5) only stored so i need to select specific_product_id = 4</p>
  
  <p>I used this query </p>
  
  <pre><code>  SELECT * 
      FROM table_product 
     WHERE astatus = 'APAST' 
       AND specific_product_id NOT IN (SELECT specific_product_id 
                                         FROM table_user_ownned_auction )
  </code></pre>
  
  <p>...which takes this long:</p>
  
  <blockquote>
    <p>Query took 115.1039 sec</p>
  </blockquote>
  
  <p>...to execute.</p>
  
  <h3>EXPLAIN PLAN</h3>
  
  <p><img src="https://i.stack.imgur.com/roeo6.png" alt="enter image description here"></p>
  
  <p>How can i optimize it or any other way to select what i want? </p>