title: Best practice with mysql innodb to rename huge table when table with same name already exist
body: <p>I Use Mysql 5.5..  + INNODB and windows server.</p>
  
  <p>The case(make it simple then real case):</p>
  
  <p>I have 2 tables 1GB with name <code>new_car</code> and <code>car</code> table 1GB.</p>
  
  <p>I to replace <code>car</code> table with <code>new_car</code> table every 10 hours not manually(auto by code) - important to do it fast(real website data).</p>
  
  <p>I read(say that drop its problem in innodb) :<a href="http://www.mysqlperformanceblog.com/2011/02/03/performance-problem-with-innodb-and-drop-table/" rel="nofollow">http://www.mysqlperformanceblog.com/2011/02/03/performance-problem-with-innodb-and-drop-table/</a></p>
  
  <p>solution1:</p>
  
  <pre><code>DROP TABLE car;
  RENAME TABLE new_car TO car;
  </code></pre>
  
  <p>Solution2(making drop in the end -maybe it not block the table to access that happen during drop):</p>
  
  <pre><code>RENAME TABLE car TO temp_car;
  RENAME TABLE new_car TO car;
  DROP TABLE temp_car;
  </code></pre>
  
  <p>Solution3(Truncate delete fast the table and create empty table then maybe drop action after should be very fast):</p>
  
  <pre><code>TRUNCATE TABLE car;
  DROP TABLE car;
  RENAME TABLE new_car TO car; 
  </code></pre>
  
  <p>Solution4:</p>
  
  <pre><code>RENAME TABLE car TO temp_car;
  RENAME TABLE new_car TO car;
  TRUNCATE TABLE temp_car;
  DROP TABLE temp_car;
  </code></pre>
  
  <p>Which solution is the best and why or please write other better solution?</p>
  
  <p>Thanks</p>