title: Effects collateral REPLACE MySQL
body: <p>I'm doing tests with two distinct database tables, where I'll run a CRON every X seconds to run a PHP script I did. I did many tests working with many lines (3,000,000+) In the more optimized code I got, checking to see if it contains update / insert from table X to Y, it took 17 seconds. </p>
  
  <p>When I removed the check on UPDATE / INSERT and replaced for REPLACE the time decreased to an incredible 4 seconds. </p>
  
  <p>My question is regarding the effects of this because so fast and I do not see many people using it? As this is a table from the Database X to a Table of the Database Y, to check for update will be by PRIMARY KEY, that is, it will not contain Auto Increment.</p>
  
  <p><strong>RESUME</strong>: I need to synchronize one table with another, running the script with REPLACE, I was incredibly faster than checking to see if it contains update and inserting. What is the real disadvantage of replace?</p>