title: How to update millions of records in MySql?
body: <p>I have two tables tableA  and tableB. tableA has 2 Million records and tableB has over 10 millions records. tableA has more than thirty columns whereas tableB has only two column. I need to update a column in tableA from tableB by joining both tables.</p>
  
  <pre><code>UPDATE tableA a 
  INNER JOIN tableB b  ON a.colA=b.colA
   SET a.colB= b.colB 
  </code></pre>
  
  <p>colA in both table has been indexed.</p>
  
  <p>Now when I execute the query it takes hours. Honestly I never saw it completed and max i have waited is 5 hours. Is their any way to complete this query within 20-30 minutes. What approach should I take.</p>
  
  <p><strong>EXPLAIN on SQL Query</strong> </p>
  
  <pre><code>"id" "_type" "table" "type" "possible_" "key" "key_len"   "ref"   "rows" "Extra"
  "1" "SIMPLE" "a"     "ALL"  "INDX_DESC" \N    \N          \N   "2392270"  "Using where"
  "1" "SIMPLE" "b"     "ref"  "indx_desc" "indx_desc" "133" "cis.a.desc" "1"  "Using where"
  </code></pre>